better time calculation