ROGER Federer is back. After missing the second half of last season to injury, falling to 17th in the official rankings, and facing a daunting climb back to the top at the age of 35, Mr Federer could have been forgiven for treating the remains of his tennis career as a sort of year-long retirement party. Instead, he has won 19 of his 20 matches in 2017, triumphed in the Australian Open to claim his first grand-slam trophy since 2012 and—for the first time in a rivalry that has spanned 37 meetings—defeated his longtime nemesis Rafael Nadal three times in a row. On April 2nd he beat the Spaniard to win the Miami Open, having previously overcome him on the way to winning the Indian Wells Masters on March 19th and in the final in Melbourne on January 29th.

These three titles have moved him up to fourth place in the official ranking table and top spot in the “Race”, which only counts performance in 2017. Both measures are calculated by the Association of Tennis Professionals, the organising body for the men's game, and are used to determine seedings at tournaments. According to the Elo rating system, which is a better predictor of match outcomes because it considers a longer period of performance and the quality of a player’s opposition, Mr Federer has risen to number three. Only Novak Djokovic (who is atop the Elo list, but second in the ATP rankings) and Andy Murray (the other way around) sit above him.

Mr Federer’s resurgence has taken place with Mr Murray and Mr Djokovic largely on the sidelines. Less than three months ago, the ATP season was shaping up as a battle royale between the two 29-year-olds. Late in 2016, Mr Murray finally wrestled away the official top spot from Mr Djokovic, and to open the 2017 campaign Mr Djokovic overcame Mr Murray in a bruising three-hour-long final in Doha. But the pair has combined for only one semifinal-or-better showing since, and neither has faced Mr Federer this season. Both men sat out Miami due to injury.

In the meantime, Mr Federer’s most frequent opponent has been Mr Nadal. From 2008 to 2014, the brawny Spaniard won 15 of their 19 meetings, making him the only opponent that Mr Federer could not solve for such a long period of time. Mr Nadal has always used his extreme topspin to take advantage of Mr Federer’s elegant but relatively weak one-handed backhand, a tactic that served him well for a decade. Single-fisted backhands are typically less effective against powerful, high-bouncing shots, which is why Mr Djokovic and Mr Murray—both of whom hit two-handed backhands—have had more success against Mr Nadal, even on clay.

Yet this season the suave Swiss has managed to neutralise that advantage. Mr Federer credits a larger racquet—to which he changed in 2014—and finally accumulating enough time on the practice court to effectively use it. The bigger racquet head allows him to be more aggressive against Mr Nadal’s booming topspin, a strategy that has paid handsome dividends.

As measured by Backhand Potency (BHP), Federer’s improved backhand represents most of the difference between his recent triumphs and past struggles against the Spaniard. BHP, which draws on shot-by-shot logs from the Match Charting Project, simply tallies the effect of individual backhands: +1 for a winner or an opponent’s forced error, -1 for an unforced error, +0.5 for a backhand that sets up a winner on the following shot, and -0.5 if it results in an unforced error on the following shot. Taking his career as a whole, Mr Federer’s BHP has been roughly neutral—a positive effect of 0.2 per 100 shots—but in ten grand-slam matches against Mr Nadal before this season, it was never positive. In the final of this year’s Australian Open, however, his mark was +7.8 per 100 shots—+17 over the entire match—which translates to roughly 11 points that he wouldn’t have won with a neutral backhand. Given the small margins of a five-set clash, that’s enough to flip a loss to a win.

In his subsequent two matches against Mr Nadal, Mr Federer has continued to display an improved backhand. At Indian Wells, his BHP against Mr Nadal was +1 per 100 shots, and in Miami it was a whopping +10 per 100 shots. Tennis will always be statistically noisy, so it is wrong to conclude that the backhand was ten times as good in one match than it was in the other. Instead, the numbers taken together indicate that, over these three matches, Mr Federer has finally turned a weakness into a modest strength. The secondary effects of a stronger backhand may be even more useful. In the final of the Australian Open, Mr Nadal targeted his opponent’s left flank, meaning that Mr Federer could only hit his signature forehand 6% more often than his backhand. By the Miami final Mr Nadal had abandoned the tactic, allowing the Swiss to use 86% more forehands than backhands. Some of that change is also due to Mr Federer's aggressiveness in hitting "inside-out" crosscourt forehands from the backhand side of the court. In Miami, as in the Australian Open final, two thirds of his inside-out forehands resulted in a point-ending winner or error, compared to a tour average of 30% and a career average for the Swiss of 36%.

Given Mr Federer’s current form, it is possible he will reclaim the top spot in both Elo and the official rankings. In Elo, he trails Mr Djokovic by approximately 110 points, and each victory against him would close the gap by about 20 points. Wins against weaker players improve Mr Federer’s Elo rating as well, but by smaller amounts. His victory in Miami on April 2nd against Mr Nadal—himself now fourth-best on the Elo list—was worth six points. Of course, strong showings by Mr Djokovic or Mr Murray would improve those players’ ratings too.

Mr Federer’s path to number one in the ATP rankings is even more uncertain. The Swiss has announced that he plans to skip most of the clay-court season, returning only for the French Open in late May. A sparse schedule might be the right prescription for his 35-year-old body, but since a player’s official ranking is the sum of his 18 best tournament performances, skipping so many events limits the heights to which his ranking can climb. As with his place in the Elo table, Mr Federer’s year-end ranking depends a great deal on whether Mr Djokovic and Mr Murray resume their elite-level play.

If Mr Federer does ascend the ATP table once again, a position he last held in 2012, he will be the oldest player ever to do so. Returning to the top after a long hiatus is not unprecedented—Mr Nadal did so in 2013, after missing the second half of the previous season—but even with the trend of older champions in tennis, reaching such heights at 35 is unprecedented. And while Andre Agassi briefly took over the top spot for two weeks at the age of 33, no man in his thirties has ever finished the year as top dog.

The statistics have little to tell us about whether Mr Federer’s improved backhand would withstand the clay-court prowess of Mr Nadal. It is also impossible to say how much of an effect the new weapon will have in future contests with Mr Djokovic and Mr Murray, neither of whom the Swiss has faced since the beginning of 2016. It is clear, however, that Mr Federer’s 2017 is much more than a valedictory tour. The ageing great is refusing to go gentle into that good night.