A change of ball played a crucial role as New Zealand wrapped up the Sri Lanka innings within the first hour on day four before going into lunch with a 227-run lead with eight second innings wickets in hand in the second test in Colombo.
Maybe all they needed was a bit of luck to end their form slump and it came when the new ball had to be changed for the fifth time in the match after losing its shape yet again on day four.
With a new swinging ball in hand Tim Southee completed his third career five-wicket bag and Trent Boult picked up three wickets in the session as New Zealand needed just eight overs to wrap up the Sri Lankan innings and hold a 168-run lead. At lunch the Kiwis were 59-2 with first innings century-makers Kane Williamson (11) and Ross Taylor (1) at the crease.
The 168-run innings lead is the second-biggest lead by a New Zealand side in Sri Lanka and puts them in a great position to end a five-test losing streak. New Zealand are also out to end an even bigger drought in Sri Lanka where they haven't beaten the hosts since 1998.
After toiling away for 40 overs and getting Sri Lanka past the follow-on mark on day three, Thilan Samaraweera and Suraj Randiv failed to add to Sri Lanka's overnight score when Boult broke up their 97-run seventh-wicket partnership in the fourth over of the day.
Boult got a touch of away swing which squared Samaraweera up and forced a thick edge through to Martin Guptill at second slip. Samaraweera departed for 76 and became Boult's 100th first-class wicket in the process.
He made it 101 in his next over, trapping Suraj Randiv lbw for 39.
Southee completed his well deserved five-wicket bag when the out swing continued, getting the edge from Nuwan Kulasekara to Taylor at first slip for six. Boult made it four thanks to a brilliant one-handed diving catch by Kane Williamson at gully to dismiss Rangana Herath for five. Southee finished with 5-62 and Boult 4-42, taking 3-8 from his four overs on day four.
The bad batch of balls continued in New Zealand's second innings, with two replacements needed inside seven overs. Guptill and Brendon McCullum got through to 32 before Shaminda Eranga had Guptill edging to Dilshan at gully for 11.
McCullum got to 35 from 43 balls and looked in ominous form with seven boundaries before he out-stretched for a Herath delivery and was stumped.