Streamlined the average price calculations.