added code to stop motion when a distance goal is reached in attraction mode