The stock market had a generally positive day on Wednesday, with the Dow and S&P 500 up fractionally, and the NASDAQ slightly down, as market participants grew a bit more optimistic that Republicans in  Washington might achieve some progress on their key domestic policy issues this year. The third-quarter earnings season has also gone well: About three-quarters of the companies that have reported so far have given investors positive surprises on the bottom line. Other markets have also fared well. Crude oil, for example, has climbed above the $55 per barrel mark for the first time since 2015 .

All of those factors have helped lift the market, and strong performances from individual stocks have also contributed to favorable sentiment. U.S. Steel (X -0.90%), Westport Innovations (WPRT 1.06%), and B&G Foods (BGS 1.42%) were among the best performers on Wednesday. Below, we'll look more closely at these stocks to tell you why they did so well.

U.S. Steel strengthens its business

U.S. Steel rose almost 8% after the steelmaker reported third-quarter financial results late Tuesday.  Revenue jumped by more than 20%, and adjusted net earnings per share were substantially  higher than most analysts had anticipated. CEO Dave Burritt was understated in his comments about the quarter, saying that the results were "modestly better than we expected, with stable operating performance at each of our segments." Balance sheet improvements and next-generation steel product development were key parts of U.S. Steel's strategic plan, and management's outlook was favorable. With the company having committed to major investments to update its assets and improve its operational efficiency, U.S. Steel's latest results could help build momentum that will carry the steelmaker through the inevitable ups and downs that all cyclical businesses face.

Control center with extensive monitoring equipment at a strip steel mill.

Image source: U.S. Steel.

Westport gets a win

Shares of Westport Fuel Systems gained more than 7% in the wake of its winning a competitive tender  bid with a key customer in Algeria. The National Company for Petroleum Products Marketing and Distribution, or NAFTAL, awarded Westport's gas equipment subsidiary a contract to supply 40,000 sequential injection systems for liquid petroleum gas. It's the largest contract that Westport has gotten from NAFTAL so far, and Algeria is a key market for the company because it has the largest number of liquid petroleum gas-driven vehicles in Africa. Most investors are waiting for Westport's expected launch of its HPDI 2.0 fuel injection system for heavy-duty trucks, but incremental wins like this one are important for Westport to keep its fundamental business strong.

B&G Foods gets more appetizing

Finally, B&G Foods picked up almost 13%. The food company's third-quarter results indicated  a solid rebound from past performance, including a 28% jump in net sales. Even though adjusted earnings per share were down slightly to $0.55 per share, the numbers were stronger than most analysts had anticipated. B&G also raised its revenue guidance for the full year while confirming its previous range for earnings. The acquisition of the Back to Nature brand, as well as strong performance from its established Green Giant line of frozen vegetables, should become key elements of the food company's strategy, and the rebound in B&G's performance from a poor second quarter has made investors more confident about the outlook for the business overall.