adding obstacle avoidance (currently broken)