fixed time and distance bugs