Replaced distance measure with time measure

@alexwalterbos ready for review