The Dow and the S&P 500 finish strong as corporate earnings drive stocks higher