Added a prototype method for saving inventories.