change record evaluation logic to consider the distance and time between positions