fix math.abs bug deciding closest time