change calculation of time