added calculate_total_time