added current time calculation