Complete first rev of inventory functions