Jack Sock's 2017 did not always go as planned. Still, he's having quite a finish.

He won a total of only three matches at Grand Slam tournaments all year, making it as far as the third round just once and bowing out in the opening round twice. During one particularly rough stretch from August to early October, he lost five times in a row.

The 25-year-old American turned things around at the end of the season, so much so that he ended up earning a debut appearance at the ATP Finals, starting with a match against 19-time major champion Roger Federer on Sunday in London.

"It's hard when you have a bit of a period where it doesn't go as well as you would like. So he had to get back to doing the things he does really well and really believing in those things," Sock's coach, Jay Berger, said in a telephone interview.

"That's hitting a bunch of forehands, using his speed and using his intangibles," Berger said. "His ability to come forward, his hands at the net, his ability to use his touch, his ability to hit pretty dynamic shots in very uncomfortable and difficult positions. And to have fun. The No. 1 thing for us was also to have fun out there. I told him, 'We're going to have a good time, win or lose.'"

In Wednesday's draw for the round-robin format, Sock was put in a group with Federer, 2014 U.S. Open champion Marin Cilic and Alexander Zverev. The other group has 15-time Grand Slam title winner Rafael Nadal, Dominic Thiem, Grigor Dimitrov and David Goffin.

That Sock is in London at all, instead of already starting his off-season at home in Kansas City, Kansas, is significant, regardless of how he fares.

He grabbed that spot by rising to a career-high No. 9 in the rankings thanks to his first Masters Series title, at Paris last week. That made him the first U.S. man to win a tournament at the level right below the majors since Andy Roddick in 2010. Sock is also the first American to qualify for the eight-player season-ending finals since Mardy Fish in 2011. And Sock will finish a season as the highest-ranked man from his country for the first time.

All in one fell swoop.

"They were all, obviously, goals of mine. They all mean a lot in their own way," Sock said. "For it all to happen at the same time is pretty special."

He gives some of the credit for this recent surge to a mental adjustment helped along by Berger, who started working with Sock in July.

For a time, Sock said, he would experience "dips in matches (or) get too defensive."

And now?

"There's a belief in my shots. I'm going to win or lose a match playing on my terms, playing my game, which is big and aggressive and trying to dictate points," he said. "Not shying away from that."

Berger recalled watching Sock play a match at age 17.

"I saw an unbelievable amount of racket-head speed. ... I really saw a lot of the same stuff that I see now," Berger said. "And he has an incredible ability to play well in big moments."

That was on display in Paris, sure, but also when Sock teamed with Melanie Oudin to win the U.S. Open mixed doubles title as a teenager.

And when he won men's doubles at Wimbledon in 2014.

And a pair of doubles medals at last year's Rio Olympics — gold in mixed, bronze in men's.

Now Sock wants more consistency, and success, in singles, something he hopes this year's ending will help spur at the beginning of 2018.

"His best tennis is in front of him," Berger said. "I've known him for many years, and the one thing consistent with him is that he always improves, every single year. I really haven't seen any regression in his tennis or how he approaches things or how he goes about his business. I know that is going to continue."

___

Follow Howard Fendrich on Twitter at http://twitter.com/HowardFendrich

___

More AP tennis coverage: https://apnews.com/tag/apf-Tennis