added the modifyInventory function