change time calculation to use discrete straight line