took out atObstacle global variable