In 20X2, the Robinson Company switched its inventory method from FIFO to average cost. Inventories at the end of 20X1 were reported in the balance sheet at $22 million. If the average cost method had been used, 20X1 ending inventory would have been $20 million. Ending inventory in 20X2 is $23 million using average cost, and would have been $26 million if the company had not switched from the FIFO method. The journal entry to adjust the accounts to reflect the average cost method would be:

A. Debit retained earnings and credit twentory for $2 million
B. Debit retained earnings and credit inventory for $3 million
C. Debit inventory and credit retained earnings for $1 million
D. Debit inventory and credit cost of goods sold for $3 million,