When Jacinda Ardern flew out of New Zealand to Samoa last week, on the fifth anniversary of her taking over the Labour leadership, it was fitting that she left Kelvin Davis in charge of Cabinet and the country.
It was the fifth anniversary of Davis becoming deputy Labour leader to Ardern.
And without that appointment, she may not have become leader when she did - and Prime Minister a few weeks later.
Grant Robertson, the Deputy Prime Minister, was also overseas last week, and that left Davis, No 3 in the Government line-up and No 2 in the Labour line-up to manage things.
Andrew Little announced his resignation as Labour leader on Tuesday morning, August 1, 2017.
By that time, a deal had been done the night before between his deputy, Jacinda Ardern, who would replace him and Davis, who would be her deputy, in the event that Little stepped down.
That was not a given and it took some persuasion, first of Ardern, and of Little and of Davis.
Grant Robertson, Chris Hipkins and Kris Faafoi worked the phones on Monday, taking soundings from caucus to see if there had been a change in the previous 36 hours.
Former deputy prime minister Sir Michael Cullen, who died a year ago, had had a role in the leadership change.
So did former deputy Labour leader Annette King, who was retiring from politics at the 2017 election. She was close to Ardern, to whom she handed the deputy's job six months earlier.
Ardern kept a visible distance from the dealings. Since becoming Little's deputy, Ardern had done nothing to undermine him as leader.
She had kept a relatively restrained public profile. In the month before the leadership change, her polling as preferred PM was about the same as Little's, or marginally ahead.
Given the backstabbing that had afflicted Labour's first two terms in Opposition, the party could not afford to change the leadership as the result of disloyalty or forcing out Little.
That would cancel out any advantage there might be from Little leaving. Besides, Ardern was initially reluctant.
Little had whipped the caucus into a much more disciplined team after winning the leadership in 2014. His chief rival had been Grant Robertson, with Ardern as Robertson's deputy, but under Labour's voting rules, union support for Little tipped the scales for a narrow win.
Michael Cullen was close to Robertson and had publicly supported the Robertson-Ardern ticket in the 2014 contest, which also included David Parker and Nanaia Mahuta.
The advantage Little brought to the leadership was that because he had been in Parliament only a term before becoming leader, he was not associated with the entrenched factions within caucus – those that had supported former leader David Cunliffe and those vociferously opposed to him.
As the former head of the Engineering and Printing Union, he was used to leadership and he had been Labour Party president. He was a clear communicator, decisive and occasionally abrasive – in short, a strong leader - but the public never took to him.
Labour polling had been in the low 30s in the few months leading up to the leadership change but it started slipping in July. The week before the leadership change, the party's own private pollsters, UMR, had Labour on 23 per cent. That was lower than the disastrous result of 25.13 per cent at the 2014 election, its worst result in 92 years.
It was Wednesday, and in a meeting at Parliament, Little raised the possibility with Ardern of him standing aside. She insisted he tough it out and he consulted a couple of other colleagues but the poll result was kept relatively tight.
On Friday, however, Little was told that the One News-Colmar Brunton poll coming out on Sunday showed Labour on 24 per cent (the Greens had risen by 4 after Metiria Turei's admission of historic benefit fraud). He hoped it would be a temporary effect and the polls would turn back up.
But Little and Ardern decided the caucus needed to be warned about the imminent bad news and started ringing around the other 30 caucus members on Friday and Saturday.
Little also did a pre-record with TV One political editor, Corin Dann, to run with the Sunday night polling story, in which Little said he had canvassed resigning as an option.
The overwhelming feedback from caucus had been for Little to hang tough. But MPs were unnerved. Many were heading to Auckland for a Saturday night fundraising art auction - not the subject of the SFO charges currently being heard in court.
It was being held at Q Theatre in Queen St and poor polling was the main topic of private conversation.
Little and a small group of senior MPs had met before the auction at Jacinda Ardern's Pt Chevalier house to discuss the situation and share their views.
At that point, only one, Phil Twyford, suggested that Little should step down for the good of the party.
On Sunday morning, Little went to Waatea Marae in Māngere to launch Labour's campaign for the Māori seats, then returned to Wellington.
MPs knew the Colmar Brunton poll was coming out that night but most were not aware of the interview Little had given to Dann until it aired on the 6pm news.
The reaction was swift and severe. The admission he had raised the option of resigning was a killer, despite it being the truth.
"A lot of people thought the honesty was refreshing," said one MP "but if you express a lack of confidence in yourself to actually do the job, it is pretty hard to do the job."
The MPs who just the day before had told Little to tough it out, were now not sure.
Michael Cullen got onto the phone that night. He was among those who thought Ardern had to put her reluctance behind her for the good of the party and be prepared to step up.
Cullen was modest about his role in his book, Saving Labour, saying he had had "some little hand in the change of leadership in 2017, not out of disrespect for the considerable abilities of Andrew Little, but because it was clear the public did not appreciate them."
The motivation of everybody in the leadership question, was to limit the losses for Labour in order to live to fight another term in Opposition and to avoid decimation.
New Zealand First held the balance of power in a large number of polls that term and many in Labour assumed it would go with the largest polling party.
There was no talk of mounting a coup but over the next day, and before the caucus meeting on Tuesday, Robertson, Hipkins and Faafoi took the temperature of the caucus in the wake of the Sunday story on Little contemplating resignation, and a RNZ interview the next morning in which Little said Labour would not form a Government at 24 per cent.
About a third wanted Little to step down, about a third wanted him to stay, and about a third didn't know or had not been contacted.
There is a suggestion that a very unhappy Little confronted Robertson about what was happening. Perhaps the very act of taking soundings was shifting MPs' views.
Compounding the despair was news that another poll due out that night, Newshub Reid Research poll, also had Labour on 24 per cent.
If Little was still privately considering stepping down, he gave no public signs of it. Throughout Monday, he vowed to stay on and fight.
On RNZ's Checkpoint at 5pm, for example, John Campbell asked him if he would be leading Labour into the election and he said: "I am absolutely and utterly determined to do just that," he said. And he gave a similar message to MPs who asked.
Napier MP Stuart Nash said it would be a disaster to change leaders – which is not what you say if there's any whiff of change.
During the Monday media interviews, Little was forced to explain that while he had put up resignation as an option to colleagues, he had not actually offered to resign. The difference was lost in translation. If explaining is losing, he was losing badly. For those watching, it looked like the party was in a downward spin.
The importance of the next day's caucus was growing. By Monday evening, Ardern had privately agreed that if Little stepped down, she would step up. But she had to be ready, including the question of a deputy.
There had to be seamless transition with no time whatsoever wasted on Labour's internal machinations and who would fill any particular vacancy.
If Grant Robertson had anticipated himself for the deputy's job at any earlier stage, by Monday he did not. Robertson had done a good job as Little's finance spokesman but an Ardern-Robertson ticket would be too much a reminder of the past.
Ardern needed someone who would complement her and help to keep the party together in what would still be a traumatic time if Little went.
Ardern, Robertson and other close advisers decided that Kelvin Davis would be the best person to approach.
A former school principal first elected on the list in 2008 along with Ardern, Davis had a term out of Parliament. He made a heroic comeback to Parliament in 2014 after defeating Hone Harawira in Te Tai Tokerau and with the endorsement of New Zealand First.
He had made a splash in the Corrections portfolio over the management of Mt Eden prison by Serco and the detention of Kiwis in Australia.
He was well-liked. And he was from the increasingly influential Māori caucus. With seven of just 32 MPs, the Māori MPs were 20 per cent of the caucus and Davis was its top performing member. It was also a group that was particularly loyal to Little.
Annette King, who has since become High Commissioner to Australia, was assigned to call Davis at home in Kaitaia to ask him if he would be Ardern's deputy if Little stepped down.
He initially said no and that there were more qualified people. But King managed to talk him round. She knew how rare such opportunities were in politics and that they needed to be grasped at the time.
The party had turned 100 the previous year but it had never had a Māori in a leadership position. Davis as deputy would be a big deal for the Māori caucus and a strategically smart move for those who felt Little needed to go.
Having the Māori caucus onside in an alternative leadership team, could tip the balance within the caucus in terms of Little's decision.
There was still no suggestion of a challenge but having more support for a ready viable alternative made Little's choice clearer.
Ardern, who was at home in Auckland, did not make the call to Davis herself, possibly because until it was certain Little was going to go, it might seem disloyal.
Little was in Auckland, too.
He had returned to Auckland on Monday afternoon to launch the campaign of East Coast Bays candidate Naisi Chen at Massey University's Albany campus.
Press secretary Mike Jaspers accompanied him. Perhaps knowing a huge decision was imminent, chief of staff Neale Jones joined them in Auckland and after the launch, the three of them met up at the lobby in the Stamford Plaza in Albert St where they were staying.
Willie Jackson joined them as well. He was not an MP at that stage but campaign director for the Māori seats and a list candidate.
The four of them spent an evening in conversation, going over the options, between phone calls. Kris Faafoi was the chief whip and kept Little appraised of what he knew about the caucus mood changing. It had been an anguishing day and even more anguishing night.
The EPMU, Little's old union, was strongly loyal to its former national secretary and may have been the most upset at the prospect of Little's leadership ending.
At some point Cullen called the union's party broker, Paul Tolich, a close friend of Little's and a long-serving member of Labour's New Zealand Council.
News of an alternative leadership team was spreading. Late on Monday night, Stuff reported a rumour that an Ardern–Davis ticket could replace Little if he stood down.
Davis didn't know for sure what Little's intentions were but when he woke at 4.30am on Tuesday, he had been sent a text the night before and told to make sure he made the plane at Kerikeri in the morning for caucus - code for "it's on".
"She was the quickest shower of my life," he told reporters later on Tuesday.
Little and Ardern talked Monday night. He gave her a strong indication of how he was leaning but was not ready to commit to a final decision. It was a late night and an early start.
On Tuesday morning, Little and Ardern both arrived at the Air New Zealand Koru Lounge in Auckland to catch the same flight to Wellington, but didn't speak. Ardern did not know for sure. Speculation was wild in the media that something was up because Little had cancelled morning media appointments.
At Wellington airport, a clumsy comment by Little to an RNZ reporter was taken as meaning he was staying on as leader – something like "are you on your way to caucus to resign?" Answer: "No."
The speculation lurched from a resignation being imminent, to him hanging tough.
It wasn't until Little was in the Crown car from Wellington airport halfway to Parliament that he finally confirmed to his staff he would be resigning.
Jacinda Ardern was in a taxi heading toward Parliament and she took the phone call confirming Little's decision.
Little's staff started to put the wheels in motion for a statement, caucus meeting and press conference.
It was not a big surprise for most in the caucus although list MP Sue Moroney, who had been out of the loop, was shocked and suggested that Little had been the victim of some plot.
Little endorsed Jacinda Ardern and Grant Robertson nominated Kelvin Davis for deputy.
Jacinda Ardern held a press conference in the Legislative Council Chamber with Davis. The rest of the Labour front bench was there, except Little who had gone on leave.
It was a commanding performance by Ardern done in 24 minutes as she answered questions about her readiness for the job, the party, and the campaign.
"We are not going to come out of the election at 24 per cent," she said, and she was right.
Andrew Little became an instant Labour hero for stepping down and respect for him only grew once the election result came through.
Labour polled 36.9 per cent and New Zealand First, which held the balance of power, made her Prime Minister in a Coalition Government with the support of the Greens.
New Zealand First leader Winston Peters became Deputy Prime Minister and Kelvin Davis became Minister of Corrections, Māori – Crown Relations, Tourism and Associate Education.
Andrew Little became Minister of Justice, Treaty Negotiations, Minister for the GCSB and SIS, and Pike River Re-entry. In the Government's second term, he has relinquished Justice and is now Minister of Health.
Once Peters was out of Parliament, Grant Robertson became Deputy Prime Minister. But Kelvin Davis remains deputy leader of the Labour Party, and occasionally acting Prime Minister.