The science behind Profit Optimized Inventory