Less than two weeks ago, the Mets were a sinking ship. They lost 16 of 23 games from July 27 to August 19, leaving them 5 1/2 games back of the second wild-card spot with three teams ahead of them. The Mets weren't out of it, but they were definitely going in the wrong direction.

Things are completely different now. Including Thursday night's loss to the Marlins (MIA 6, NYM 4), the Mets are now 9-3 in their last 12 games, and they've outscored their opponents 69-46 in the process. That surge has brought New York back within two games of the Cardinals for the second wild-card spot. They've made up a lot of ground in a short period of time.

Amazingly, the Mets have been able to get hot and make up all that ground despite seemingly losing another player to major injury every other day. This week we learned Neil Walker will have season-ending back surgery. Steven Matz has a tight shoulder and will be out a while. Jonathon Niese needed knee surgery. Jacob deGrom had to skip a start with fatigue.

Take a look at the lineup the Mets used on Opening Day. They were in Kansas City to play the Royals to start the season, so they had a DH. Four of the nine starting position players plus their starting pitcher are all out long-term with injury. Check it out:

  1. RF Curtis Granderson
  2. 3B David Wright -- out for the season following neck surgery
  3. CF Yoenis Cespedes
  4. 1B Lucas Duda -- likely out for the season following back surgery
  5. 2B Neil Walker -- out for the season following back surgery
  6. DH Michael Conforto
  7. SS Asdrubal Cabrera
  8. C Travis d'Arnaud
  9. CF Juan Lagares -- likely out for the season following thumb surgery
    SP Matt Harvey -- out for the season following Thoracic Outlet Syndrome surgery

Man, that's brutal. Cespedes (quad), Cabrera (knee), and d'Arnaud (elbow) all spent time on the DL earlier this season too, and Conforto has shuttled between MLB and Triple-A because he hasn't hit much. Granderson had to be dropped in the lineup as well. He's had a rough year.

And yet, the Mets are red hot right now despite Thursday's loss, and they are very much in the postseason mix with a month to go in the regular season. Here are four reasons they've been able to turn their season around and get back into the race these last two weeks.

usatsi9503277.jpg
The returns of Yoenis Cespedes and Asdrubal Cabrera have been huge for the Mets. USATSI

1. Cespedes has been a force at the plate

One of the biggest reasons the Mets won the NL East and went to the World Series last season was the trade deadline pickup of Cespedes, who played like an MVP in the second half and carried the team. He's having an excellent season in 2016, though he hasn't quite matched the magic of 2015. That's not a surprise, right? Hard to expect a guy to do that for a full season.

Cespedes battled a quad injury for much of July and eventually the team admitted defeat and placed him on the DL. In 12 games since coming off the DL, he's gone 16 for 45 (.356) with five home runs and nine RBI. Monday night, Cespedes clocked a walk-off home run against the Marlins:

It is not at all a coincidence that as soon as Cespedes was activated off the DL, the Mets started this 9-3 run. He's a difference maker, especially when he's hot, and he's red hot right now.

2. Cabrera came back on fire, too

Cespedes and Asdrubal Cabrera were on the DL at the same exact time. Cespedes had the quad injury, and Cabrera was sidelined with a knee problem. The Mets were without their best hitter and starting shortstop simultaneously. That's rough.

Cespedes and Cabrera were activated off the DL on the same day, and believe it or not, Asdrubal has done even more damage than Cespedes since returning. He's gone 18 for 43 (.419) with five home runs and 13 RBI in 13 games since returning.

Cabrera has also improved the team defense by making plays like this:

The Mets averaged only 3.62 runs per game in the first 34 games of the second half, and that's simply not good enough. They're now averaging 5.38 runs per game in the 13 games since. Getting Cespedes back has been a huge help. Don't overlook Cabrera though. He's been very productive since coming back from his knee injury.

3. Reyes has been setting the table

It was fair to wonder exactly how much Jose Reyes would be help the Mets after they picked him up off the scrap heap. He had a decent season in 2015, but he is a year older, and he missed the first two months of the season with his suspension under the league's domestic violence policy. Reyes had a lot working against him.

Reyes hit three home runs in his first six games with the Mets but cooled off after that. He eventually landed on the DL with an intercostal strain and was out a little less than three weeks. Reyes returned a few days before Cespedes and Cabrera, and since then, he's gone 28 for 82 (.341) with a home run and three steals. He's put up a .398 on-base percentage from the leadoff spot. The finally have a high-end table-setter.

4. A replacement starter has been a godsend

Who would have guessed the Mets would need to dip this deep into their farm system for pitching help this season? They came into 2016 with, by far, the best rotation in baseball (on paper). That starting staff is the single biggest reason they went to the World Series a year ago.

Things have not worked out as hoped this year. Noah Syndergaard has been fantastic, but Harvey had to undergo season-ending surgery, Matz's shoulder has flared up, and lately deGrom hasn't been quite like himself. Add in the fact Zack Wheeler's return from Tommy John surgery has been delayed, and the Mets had a borderline rotation crisis on their hands.

In fact, earlier this week the Mets started call-ups Robert Gsellman, Rafael Montero, and Seth Lugo in three straight games. No offense to those three, but they're not Harvey, Syndergaard, and deGrom. Lugo, however, has made three starts with the Mets now, and the results have all been good to great:

Date Opp. IP H R ER BB K HR
August 19
@ Giants 6 2/3 7 3 3 1 3 0
August 25
@ Cardinals 5 5 0 0 3 5 0
August 30
vs. Marlins
6 5 2 2 1 4 1

That's three pretty nice starts, including two in hostile road ballparks. Lugo did it thanks to his trademark curveball, which is baseball's best in terms in spin rate:

In English, that means Lugo's curveball rotates faster than any other curveball in baseball right now. Here's what an elite spin rate curveball looks like:

That sure is a pretty breaking ball. With Lugo possessing a pitch like that, there's reason to believe his small sample success with the Mets these last few weeks is no fluke. He has a legitimate bat-missing pitch, and that can go a long way. Lugo is something like New York's No. 7 or 8 starter, and he's holding down the fort while the team deals with some rotation injuries.

The Mets are not firing on all cylinders right now. They're still waiting for Granderson and Jay Bruce to get going, and of course they're missing Matz and hoping deGrom rights the ship soon. Getting Cespedes, Reyes, and Cabrera back from the DL has helped the offense big time, and Lugo's provided a nice lift to a rotation that was bordering on disaster.

Keep in mind the Mets have an incredibly easy September schedule, at least on paper. They'll play 19 of their remaining 28 games against the Braves, Phillies, Reds, and Twins. They still have to win those games, of course, but the opportunity will be there for the Mets to beat up on some rebuilding teams the last few weeks, so hooray for the unbalanced schedule. The Mets may have lost Thursday, but they've played well of late overall and are poised to be a dangerous team in September.