Redone writeInventory()