Got the inventory update function working.