Barcelona’s success is never a surprise. They have the best player in the multiverse. And beyond Lionel Messi, they have as much talent as any team in the world and as much money as any club that isn’t either Real Madrid or a subsidiary of state-owned oil fields.

Yet, last summer there was trouble in Catalonian paradise. The team had come off a season that most clubs in the world would saw off their arm for, but was unacceptable at the Camp Nou. They finished in second place in La Liga with 90 points, three behind Real Madrid. After pulling off a miracle comeback against PSG in the round of 16, they were knocked out of the Champions League by Juventus in the quarterfinals. And sure, they won the Copa del Rey, but what’s one measly trophy among culés? Manager Luis Enrique left and was replaced by Ernesto Valverde, who, despite a successful 15-year career managing in Spain and Greece, was untested at the highest levels. Then Neymar, Messi’s anointed heir, up and forced his way to PSG. And then Neymar’s record-breaking replacement, Ousmane Dembélé, proceeded to rupture a tendon in his left thigh three games into his Barcelona career.

Anyway, it’s February, Barcelona have a hefty seven-point lead in La Liga, and they haven’t lost a match. (Real Madrid are 17 points back, in fourth place.) With the team set to play Chelsea in the Champions League round of 16, Valverde fixed what ailed Barcelona, and he did it in perhaps the least likely way imaginable: by playing Paulinho, a 29-year-old Brazilian midfielder who was last seen washing out with Tottenham Hotspur before being shipped off to China.

Barcelona are playing a dramatically different brand of soccer now than they have at any time in at least a decade. When Pep Guardiola got handed the keys to the club in 2008, he conquered the world by turning Barcelona into a short passing, aggressively pressing, voracious possession machine. Three and a half years ago, when Luis Enrique took over, he modified the approach to facilitate a front three of Messi, Neymar, and Luis Suárez and account for the ultimate midfield quarterback, Xavi, riding off into the Qatari sunset. The style was still possession-heavy, and it still relied on aggressive pressing, but it mixed in more counterattacking and gave Neymar some of Messi’s on-ball creative responsibilities.

Over Enrique’s three-year tenure, though, that style began to degrade. Holes emerged that needed to be plugged by a new manager and a new player. That manager is Valverde and that player is, unlikely as it may be, Paulinho. Yes, that Paulinho. Nobody could quite understand why Barcelona were interested in him, let alone interested in him at a sky-high 40 million euros for a player of his age. But, here we are: Valverde used Paulinho to fix Barcelona.

Under Valverde’s predecessor, Barcelona attacked in a very specific way. Either Neymar or Messi would terrorize a defensive line with the ball at his feet while Suárez and the winger without the ball made runs to slice apart the defense in front of the ballcarrier. If defenses managed to contract and survive the initial onslaught, then they’d be pulled in so tightly that the fullbacks could overlap into acres of space to receive a pass and either shoot or set up a cutback. At their best, Barcelona were unstoppable.

However, that approach relied on having two wingers who could attack the back line with a dribble, a pass, or an off-ball run. With Neymar gone, Valverde’s biggest challenge was to figure out how to get enough bodies in the box to complement Messi without compromising the defense. He had a number of initial options, but none of them were quite right. Dembélé was the closest to a like-for-like Neymar replacement in the squad, but even if he didn’t get hurt, he still would have needed to learn how to move off the ball in a way that complements Messi. Gerard Deulofeu was the next wing option, and while he’ll try to dribble past everybody from Sergio Ramos to your grandma, he’s never met an off-ball run he’d consider making. (After getting minutes at the beginning of the season, Deulofeu soon dropped down the pecking order, and in January Barcelona loaned him to Watford.) And while striker Paco Alcácer is comfortable in the box, he doesn’t offer anything that Suárez isn’t already way better at.

Enter Paulinho, who despite starting only 14 games, has made the third-most appearances (23) of anyone on the team. If there’s one thing Paulinho does well, it’s run into the box and score goals. With Messi on the ball and Suárez occupying the back line, Paulinho’s primary job at Barça has been to charge forward from midfield into space and make runs that have the same kind of effect on a defense that a winger’s might. Time it right and get free for a pass, or suck the defense in and open up secondary options. He’s third on Barcelona in goals with eight, which is slightly behind his 9.06 expected goals, and in shots per 90 with 2.41. In terms of goal-scoring output, Paulinho is doing the most to replace Neymar.

Paulinho has helped solve another problem from the Luis Enrique era, too. The team was never able to replace Dani Alves patrolling the right wing, after he left for Juventus in the summer of 2016. When the front three were flying high, they were supported by Alves and Alba. Aleix Vidal was never good enough to replace Alves. And eventually, Sergi Roberto, the hero of last season’s comeback against PSG, made the right back slot his. But as a converted midfielder, he’s always been more comfortable supporting possession than bombing up the sideline. This made for some awkward trade-offs. Oftentimes, central midfielder Ivan Rakitic was asked to move from inside to out, to occupy the right wing space as Messi came inside. The club also bought Arda Turan from Atlético Madrid to try to fill that midfield-winger hybrid role, but after an awkward 18 months he’s now playing at İstanbul Başakşehir in Turkey.

However, with Paulinho providing that extra body in the box, it’s now possible for Barcelona to repurpose a player to occupy the right-side attacking space. Leave the left wing for Alba (with help from Andrés Iniesta) and play a right winger in front of the more-reserved Roberto at right back. That’s the position where Philippe Coutinho made his first start (although, as a righty who likes to cut infield, he’s an awkward fit on the right side and is unlikely to stay there), and it’s likely where Dembélé will play, unencumbered by having to also make attacking off-ball runs.

The last problem that Valverde inherited was a leaky defense. In Luis Enrique’s three seasons, his team gave up 21, 29, and 37 goals. They gave up 90, 127, and 158 shots on target. In their own penalty area, the number of shots they conceded went from 175 to 200 to 216, and the shots on target went 64, 81, 96. Their expected goals numbers don’t quite track with the shots numbers, instead clocking in at 28, 34, and 31, but the same players became less effective on the defensive end as Enrique’s time wore on.

Messi, Iniesta, and midfield linchpin Sergio Busquets all got older. Busquets dealt with nagging injuries, which didn’t keep him off the field much, but slowed him down. Alves’s departure had ramifications across the field. And opponents started to figure out Barcelona. Take all of that together, and you get a recipe for an eroded defense.

Now, this is the one problem Paulinho didn’t directly solve—a midfielder who spends most of his time in the opposition box won’t give your team a new backbone. And so Valverde has had to change the plan.

In order to account for both Barcelona’s old weaknesses and the introduction of Paulinho, he’s dialed back the press. For the first time in a long time, Barcelona aren’t harassing opponents into giving them the ball back. This season they’ve had only 60.9 percent of possession, the lowest total since at least 2009-10, which is the earliest season for which these stats are widely available. And it’s not because they’re playing fewer passes; they’re completing 564 out of 647 passes per game this year, more passes both attempted and completed than either of the past two seasons. The combination of decreased possession and increased passing numbers suggests that a team is allowing opponents to pass the ball a lot more than it used to.

Another tool to estimate pressing is a stat called PPDA, or passes allowed per defensive action. PPDA measures how many passes a team concedes in its opponent’s half of the field per defensive action it takes. It’s a rough estimate of how hard a team is trying to defend high up the field rather than sit back. The lower the number, the more aggressive the press, and this year, Barcelona’s PPDA is 8.23. They are still an active and pressing team; only Eibar, Sevilla, and Athletic Bilbao have lower PPDA values in La Liga, but last year their number was 6.31. The year before, it was 5.66, and during their treble-winning season it was 5.56.

This year, Barcelona are more concerned with dropping back and getting into a defensive shape, rather than always immediately disrupting their opponent. The result is that while Barcelona may be conceding more shots than ever at 10.6 per game—Enrique’s squads topped out at 9.61—they’re conceding fewer shots on target at 3.22. In Enrique’s first year, his team conceded only 2.37, but that number had climbed to 4.16 by last season. The more conservative defense is also blocking more shots: 2.70 a game, up from 1.53 last season. Now, while Barcelona have conceded only 11 goals, expected goals predicts that they should have conceded closer to 18. So while the change in defensive emphasis is real, at least some of the improvement may not persist if a couple of extra bounces don’t go their way.

However, given the team’s personnel, Barcelona working slightly harder to contain counterattacks rather than blow them up makes sense. A midfield pair of Paulinho and Busquets is a formidable defensive double pivot, well equipped to both break up play and spring into counterattacks. Paulinho often gets caught out of position, but he becomes the perfect tool to lend defensive solidity—as long as the rest of the squad drops back and gives him time to recover.

Barcelona’s success this year is a testament to problem solving. Valverde took a squad that was great but troubled and turned it into one that can’t seem to lose. Six months ago, the club looked like it had seen better days, and now it’s waltzing toward a domestic title and projects as favorites to win the Champions League. That Paulinho is the instrument of improvement shows how complex talent evaluation is in soccer. Situation matters just as much as talent. Paulinho didn’t suddenly become a better player; his strengths and weaknesses are what they’ve always been. He’s good at showing up in the box to score goals and being a defensive presence in midfield. He’s bad at everything else. It just so happens that Barcelona have plenty of everything else and desperately needed those two things.

Somehow, Paulinho and Barcelona are a match made in soccer heaven, and it’s put the Catalan club back at the top of the soccer world.

Some stats updated through Saturday morning.