added calculate_total