Calculating Weighted Average Cost