changed elapsed time calculation