There were a lot of things that Rafael Nadal “never dreamed of” that have come to pass for him in 2017. Reaching the Australian Open final, winning his 10th title in Monte Carlo, completing La Décima at the French Open: Nadal expressed amazement at all of these accomplishments.

Rafa did the same on Wednesday in Paris after his 7-5, 6-3 win over Hyeon Chung, which guaranteed that he would end the year No. 1. It’s the fourth time he finished a season at the top, and it makes him, at 31, the oldest man to pull it off since the advent of the ATP’s computer rankings in 1973.

“I’m very, very happy for everything,” Nadal said afterward. “Having an amazing year. One year ago for sure I never dreamed about being world No. 1 again at the end of the season.”

Despite his past achievements, Nadal had good reason to doubt that he would finish 2017, or any year in the future, at No. 1—not many others in the sport would have bet on it, either. He ended 2016 ranked No. 9, which was his lowest year-end finish since 2004, and he was forced to cut his season short due to injury. The telltale signs of long-term decline had begun to accumulate: He hadn’t made it past the quarterfinal at a Grand Slam since 2014, and he had a new, disturbing habit of losing the close matches that he had always won in the past, to the lower-ranked players he had always beaten in the past.

Yet even as he passed the Rubicon of age 30, Rafa never failed to walk into the interview room after a devastating defeat and immediately vow to do whatever it took, and try for as long as it took, to find a solution to his problems. What was that solution? He found his forehand again, he varied his serve more, he hired a new coach, in Carlos Moya, and he won a couple of key close matches early in the year, which restored his confidence that he could still play his best when it mattered most. Maybe most important, he stayed injury free; 2017 was just the second time in Nadal’s career that he played all four majors and all nine Masters 1000 events.

But rather than anything new, I think Nadal solved his issues the same he always has: with energy. It’s a word that Rafa likes to use. He loves the sun because it gives him energy; he praised Moya this season for bringing new energy to his team; and he often explains his victories by saying he played with the “right energy.”

Nadal showed again in his win over Chung what the right energy can do. While an upset was unlikely, Rafa looked nervous to start. His forehand was sailing on him, and he was broken at 1-1. While he turned things around quickly enough to lead 5-2, he let that lead slip and actually found himself serving at 5-5 and facing a break point. A sharply angled serve and a forehand winner took care of that, and Nadal was never in serious danger again.

When we talk about confidence, we talk about it as if it’s something out of our control, that comes and goes with the breeze. And often it is. But Nadal shows us one way to control it, and manufacture it: with energy. Compare his body language to virtually anyone else’s on tour, even many of his fellow Top 10 players. Nadal never hangs his head or walks lackadaisically or reacts with prolonged disgust or lets anything continue to bother him or distract him. The energy is always positive, and it’s the best antidote any player has to nerves or lack of confidence. E, to steal an equation, equals C2.

Numbers-wise, this likely won’t go down as Nadal’s all-time best year. Who knows if he would have finished it No. 1 if Novak Djokovic and Andy Murray had been healthy, or if Roger Federer, who beat him in all four of their meetings, hadn’t sat out the clay season. But even Rafa’s best earlier years came with their share of ups and downs, and that wasn’t the case in 2017.

Nadal reached the finals on hard courts in Melbourne and Miami; won on clay in Monte Carlo, Barcelona, Madrid, and Paris; and won on hard courts again at the US Open and in Beijing. Instead of essentially writing off the fall, as he once did, he has reached the Shanghai final, and now has a chance to win his first title in Bercy.

Rafa would probably be the first to tell you that he “never would have dreamed” that he’d have his most consistent season at age 31. But he has played 2017 with more energy, and more of the “right energy,” than anyone else, and that’s why he’ll finish a well-deserved No. 1.