a implementation of behavior tree