Inventory Rewriting