computing the cost of goods sold