Ernests Gulbis once said that everyone should go to jail at least once in their lives.

Presumably he also believes in second chances and though he has had more than one crack at it, there are signs that at the age of 24, he may finally be on the right path to fulfilling his potential.

Gulbis finished last year ranked No.136 but after a volte-face in terms of his off-court preparation, he has won 13 straight matches, including a third career title in Delray Beach.

Today he gets the chance to test himself against one of the very best when he plays Rafael Nadal, in the Spaniard's first hard-court tournament in a year, for a place in the quarter-finals of the BNP Paribas Open.

The points he has earned here will send him close to the top 50, so how has he done it? By behaving truly like a professional sportsman, perhaps for the first time in his career. "I think I'm going to make it back to top 20 this season, for sure," he said. "I've quit a lot of things in my life. I quit smoking, drinking, staying up late." This is a man who once, in answer to a question about his liking for travelling by private jet thanks to his uber-wealthy father, said he also had a "helicopter, submarine and a spaceship".

It is a mark of Gulbis's talent that for all his false-dawns – and there have been many – he remains interesting, relevant and more importantly, capable of playing some outstanding tennis. He possesses brute force and delicate touch; on his day, he is top-10 quality; on his off-days, he would struggle to break the top 200.

"Of course I got smarter a little bit. First of all, I skipped Australia, did a longer preparation, practised really well and then, yeah, nothing really interesting to say about it. Hard work pays off eventually. That's it."

Gulbis grew up training in Germany with Novak Djokovic and is a contemporary of Andy Murray, Juan Martin Del Potro and Marin Cilic. When he reached the quarter-finals of the French Open in 2008 as an 18-year-old, the only way seemed up, but life got in the way. Famously, the Latvian did not apply himself to practice the way his friends had done; instead he had highs, such as beating Roger Federer in Rome three years ago but they were outweighed by inconsistency. But having qualified in Delray Beach, he won the title and has already won five matches here. Nadal may be a little vulnerable in his first hard-court tournament in a year and Gulbis is not short of confidence.

"I like to play against Nadal because his ball and his heavy spin is good for my timing," he said. "I don't like when the opponents hit flat, deep balls. I like when they hit spin, high balls. It's easier for me to control them.

"When I play him now I know how he plays. Of course he's a great player but I honestly believe that if I play my best game I can beat him. I'm going to go for my shots – of course maybe it's going to take me more than one shot. Maybe it's going to take me two shots. One shot, one corner, one shot, other corner. I want to see him get it."

Gulbis would like nothing more than to prevent Nadal from setting up a likely meeting with Federer in the quarter-finals. Federer cruised past Ivan Dodig of Croatia in round three but tweaked his back late on.

"I'm not too worried," said Federer, who plays fellow Swiss Stanislas Wawrinka today. "I've gone through it so many times where you feel a little tweak. You might play next day; now this time around I have a day off, extra time. It's happened during grand slams, during tournaments, in practice. It's just something you learn to deal with. After this I also know I have a longer break to recover, so from that standpoint I'm not worried."

Murray was due to play Taipei's Yen-Hsun Lu in the third round late last night.