Added calculation of current time