added function calculate_total into calculator