changed total time to variable