Created calculate_bills and its helpers.