Building a behavior tree