added some obstacle avoidance