Updated the code for the Inventory class