Updating code to use StockCost model