Redid distance and time variables to make them instance variables rather than elements of a dictionary