The worst is over on the stock market