time is set from the clock

distance function was broken, made it less broken, but still needs to be
fixed