Finished new writeInventory()