Building a stock market model