updated the stock example solution