modified the total price calculation