Error in avoidDeadEnd(), should have been rotate instead of travel on 2nd line - fixed