Completed an initial version of the method for avoiding obstacles.