the algorithm to add the prices for the total