added state based implementation of the stock object