Adds obstacles avoidance. 
Moving returns final direction in addition final position.