added calculate_total function
resolved merge