MARTINSVILLE, Va. -- Denny Hamlin was beyond frustration two weeks ago when a stalled engine on a green-white-checkered restart cost him the victory at Bristol Motor Speedway. So many bad things had happened to his Sprint Cup team in the first five races of this season and the last half of 2007 that he felt he was cursed for sure.
He was, as Joe Gibbs Racing president J.D. Gibbs so politely put it, in a bad mood.
What a difference a win can make.
Hamlin led the final 74 laps of a race many felt would never get to the halfway point because of cold, wet weather and held off a late charge by Jeff Gordon to put all the frustration behind him.
"First, baby! Finally!" Hamlin yelled over his in-car radio as he took the checkered flag at Martinsville Speedway for the first time. "Finally!"
Yes, Hamlin was emotional.
The emotion was even more exaggerated because the win came 167 miles from his hometown of Chesterfield, Va., on a track that was his Super Bowl when he was running Late Models.
"I used to think maybe his mood was about stuff off the track," Gibbs said as he watched Hamlin celebrate. "It's all about racing. If he runs well, he's in a good mood. If he doesn't, he's in a bad mood.
"So much of the way he feels about life in general is dictated by how that car runs."
Crew chief Mike Ford understands.
"I've been married a long time," he said. "I know you can't always make people around you happy. He's a severe competitor. It is good to know that you have someone in there that is strictly performance-motivated.
"At times, you think the world is painted dark. But like J.D. mentioned, we've learned -- I won't say to overlook -- but to look past the mood and focus on performance."
Hamlin's mood and performance were just fine Sunday. He remained focused, even when a midrace mistake to pit when the rest of the leaders didn't took him from first to 20th.
The 2006 rookie of the year thought he was on older tires than he actually was when caution came out on Lap 208. He moved down on the half-mile track assuming everybody would pit, particularly when Gordon made a move inside.
By the time Gordon pulled out, Hamlin already had crossed the commitment line. He had no choice but to come in.
"If that was what cost us the race, it was going to be on my shoulders," said Hamlin, who has three top-3 finishes in his past six races at Martinsville. "Frankly, I didn't want that, so I went out and won it."
Hamlin slowly battled back, taking the lead from Jeff Burton on older tires than most because of a decision to take only fuel on his final pit stop. He stretched the lead when Burton got a little sideways and held up challengers Gordon, Jimmie Johnson, Tony Stewart and Dale Earnhardt Jr.
He survived the final laps under a heavy mist with Gordon closing fast.
Good thing. Otherwise, his mood really would have gone south.
"It's been difficult," Hamlin said of his slow start. "It's hard to be patient when you get so close to winning so many races and something bad happens or things just don't work out in your favor. It's tough to maintain confidence. Your self-esteem starts going down.
"We had a chance to probably win three in a row. Just the first two races we had a lot of problems."
Hamlin, who hadn't won since the July race at New Hampshire last year, said he believed the entire second half of last season was a problem. He was extremely frustrated after finishing 12th in the Chase for the Cup a year after finishing third.
He knew his performance was better, but the results weren't coming.
"You definitely start to have doubt when things don't go your way," Hamlin said. "You hear it from veterans that have been around the sport 10 and 20 years. [They tell you] you keep having bad breaks, eventually it's going to turn around.
Finally, to have something go our way, I definitely feel maybe this is the turning point for our team.
-- Denny Hamlin
"Finally, to have something go our way, I definitely feel maybe this is the turning point for our team."
Gordon and Burton said Hamlin is going through the same thing every good driver on the circuit has experienced. They said he'll go through it again if he hangs around long enough.
"That's how this sport is," said Burton, whose win at Bristol came at Hamlin's expense. "When things are good, enjoy them. Don't take it for granted. When things are bad, you have to understand you can't feel bad about it."
"Us old guys, once you've been in the sport long enough, it all goes up and down, up and down," he said. "You just kind of realize how to get through the peaks and valleys.
"He probably was just being a little hard on himself."
If anybody should have been frustrated Sunday, it was Gordon and his Hendrick Motorsports teammates. Gordon led three times for 90 laps, Johnson five times for 135 and Earnhardt five times for 146.
Despite finishing second, fourth and sixth -- not to mention that teammate Casey Mears was seventh -- none walked away with the coveted grandfather clock that goes to the winner.
That belonged to Hamlin, who led three times for 82 laps.
"Me and Mike had a conversation last year about trying to find happiness in something else besides winning because ultimately we're in a losing game," said Hamlin, alluding to the fact that nobody can win every week. "Slowly but surely, I'm starting to figure that out."
David Newton covers NASCAR for ESPN.com. He can be reached at email@example.com.