Implemented obstacle avoidance.