calculation of time works now.