Back in early June, I wrote about Pittsburgh’s impending recall of Gregory Polanco, with the viewpoint that while he would be a welcome upgrade over Travis Snider and Jose Tabata in right field, he wasn’t going to single-handedly save the Pirates’ season, since he wasn’t a pitcher.

Or as I put it at the time:

They were the worst in April. They were the worst in May. If you prefer RA9-WAR rather than FIP-based WAR, it’s 27th. If you like FIP, they’re 29th. ERA has them at 15th, which is something. You’d have to do some serious contorting to make the argument that the Pirates have anything other than a considerably below-average pitching staff.

Which was true! Even taking into account a much better June, the first-half Pirates pitching situation wasn’t much to be proud of, ranking either last or in the bottom third, depending on whether you like your WAR based on FIP or RA9. Though the offense, even with Polanco’s fade and Andrew McCutchen’s absence, has generally been outstanding, the pitching wasn’t holding up its end of the bargain, especially compared to how good they had been last season.

It wasn’t hard to see why, really. Francisco Liriano had taken a step back, and Gerrit Cole hadn’t taken the expected step forward. A.J. Burnett was gone, and Edinson Volquez wasn’t exactly matching Burnett’s 2013. Wandy Rodriguez had been a disaster. So had Jason Grilli. Jameson Taillon blew out his arm, taking a possible reinforcement out. The Pirates haven’t been in first place since April 8, and with the Brewers surging, the season was quickly fading. At one point in late June, they were one game over .500 and eight games out.

GM Neil Huntington’s solution to the pitching crisis was, let’s say, muted. Rodriguez was released in May, and reliever Bryan Morris was sent to the Marlins for a competitive balance pick on June 1. Grilli went to the Angels on June 27 for Ernesto Frieri; Grilli has excelled in Anaheim, while Frieri contributed 14 awful outings and was released three weeks ago. John Axford, who had lost his closing job in Cleveland, arrived in an August waiver trade. That’s it. Really.

There was no David Price, or Jon Lester, or Jeff Samardzija, or Jason Hammel, though calls existed in certain areas — including here, probably — that said the Pirates would be the perfect home for any of them. If there was to be improvement, it was going to have to be with what they had laying around.

Now, there’s less than a week left in the season. The Pirates have allowed six runs in their last seven games, have had one of the best run prevention units in baseball in the second half, and are all but certain to play the Giants in the wild card game next week. They still have an outside shot at unseating the Cardinals for the NL Central division title. This is better.

So how have they pulled this off? There are reasons. Let’s start with this one: Improved infield defense, and more grounders going to that defense.

I probably don’t need to spend a great deal of time telling you how bad Pedro Alvarez was on defense this year. Jeff did already, really, and the Pirates took Alvarez’ job away in mid-July, relegating him to a weird three-headed first base platoon with Ike Davis and Gaby Sanchez before he injured his foot, which has kept him sidelined for most of September.

That’s not going to stop me from providing you with a GIF that reminds you of what the Pedro Alvarez third base experience was like, of course:

Alvarez’ replacement has been Josh Harrison, who has been pretty good at third base, and that’s not a small thing. We know that the Pirates love their ground ball pitchers; that, plus a heavy usage of shifts, was part of their strategy last season. That still held true in the first half this year, when they led baseball with a 49.5% ground ball percentage. In the second half, that’s now 52.5%, nearly four percentage points higher than any other team.

Like most teams, most of those ground balls go to the left side:

While Jordy Mercer is a capable shortstop, think about where Alvarez would have been positioned in that heat map — or, better yet, don’t. Envision Harrison instead. It’s better for your health. In Monday night’s 1-0 win over the Braves, the Pirates had all of four fly ball outs. 23 of them came via the strikeout or the grounder. Grounders don’t turn into homers, obviously, and only four teams have a lower second-half HR/9 than the Pirates do. More grounders, less Alvarez, more outs.

Though not to the same extreme, you can also make that case behind the plate. Russell Martin, loved by pitch-framing metrics and by DRS, missed most of May with a hamstring pull, meaning he was out during some of the lowest points of the Pirates pitching season. It’s not hard to see that a team with Martin and without Alvarez is going to find some additional outs on defense.

But of course, there’s only so much the support staff can do if the pitchers can’t get the job done. In the bullpen, that’s largely due to the two new arms acquired via under-the-radar deals. In June, John Holdzkom and his palmball were still pitching in the independent leagues. He’s now struck out 12 of the 27 major league hitters he’s faced and has yet to allow a run. The Pirates can thank Mal Fichman, a scout toiling away in the plains, for that one, because there are out of nowhere stories, and then there’s John Holdzkom. I’d like to offer more analysis on that, but sometimes the magic is right on the surface, without much further exploration required.

Axford was a mess in Cleveland and hasn’t really fixed his issues — his zone percentage is down and his contact rate is up with the Pirates — but he’s managed to find better outcomes anyway, probably not unrelated to leaving the wretched defense in Ohio. There’s a very good chance that’s not going to last, but for the moment, it has. Suddenly, with Mark Melancon and Tony Watson heading up the bullpen and Holdzkom, Axford, Justin Wilson and Jared Hughes working as capable setup men, Pittsburgh has something that looks like a real live bullpen.

In the rotation, Vance Worley, who had been purchased by the Pirates from the Twins at the end of spring training, has turned solid control and decent batted ball luck into 16 starts of 2.93 ERA work, even if his peripherals haven’t really supported it. Worley had tailed off lately before beating Milwaukee 1-0 on Sunday, but really, his worth was in covering for the injury-related absences of Cole and Liriano, each of whom are back and producing.

Liriano, especially, has been outstanding lately; in his last six starts, he’s allowed three runs. It’s fair to note that included among those teams are the Reds, Phillies, Red Sox, and Braves, all struggling on offense, and that against Boston, he walked five and whiffed two. It’s also fair to note that the oblique injury that cost him more than a month in May and June was a serious issue, and that his slider has been a much more effective weapon since his return, as the whiff percentage indicates:

Cole, who missed time earlier as well with shoulder fatigue, is back and also pitching well. For a time, Pittsburgh was limping along with all three of their top starters from last year (Brandon Cumpton and Jeff Locke joined Volquez, Charlie Morton, and Worley for several weeks in June). Now, Liriano looks something like what he was before. Cole has been good enough, if not the star we expected. Martin is back. Alvarez is gone. Holdzkom is in the bullpen; Grilli and Frieri are not.

The Pirates, over the last month, have the fifth-highest strikeout percentage in baseball. They have, of course, the highest groundball rate. They have the third-lowest home run rate. They still walk too many, but no team has allowed fewer runs. If you want to argue that ‘the last 30 days’ presents a small sample size issue, well, of course it does, but the improvements started months ago, and it’s put them into the playoffs when that certainly seemed unlikely in June. (That Milwaukee and Atlanta totally fell apart didn’t hurt either, of course.)

It’s not that the Pirates staff is better than they were at this time last year, because they probably aren’t. It’s that they’re better than they were four months ago, which is huge — and, with a better offense than last year’s collection provide, they might not need to be.