Added obstacle avoidance