When John Key said he would form a government within a week it seemed an optimistic target.
He had to strike deals with two parties -- ACT and the Maori Party -- and glue on United Future leader Peter Dunne.
He has done it, and there hasn't previously been a government quite like it.
It is a National-led minority government. The cabinet is 100 percent National, there are no coalition partners.
It is supported on confidence and supply, the crucial votes that have to be won by a government to stay in power, by parties that have signed agreements to do that in return for ministerial positions outside cabinet and policy concessions.
ACT and the Maori Party are equals under this arrangement. They both have five seats, their agreements are technically very similar.
National's relationship with ACT was always going to happen. Rodney Hide's party has been a partner-in-waiting for more than a decade.
Key's really important achievement has been to mould an unprecedented alliance with the Maori Party.
In doing so he has significantly lessened Labour's chances of winning the next election. If this new accommodation works, the Maori Party's support for National will be locked in through to 2011 and beyond.
As much as anything, and perhaps more than anything, it is based on respect. The Maori Party feels it is being treated like an equal in a co-operative and trusting relationship.
"In three days, National offered us more than Labour did in three years," said one of its MPs, Hone Harawira.
Harawira and his colleagues haven't forgotten the 2005 election, when Labour leader Helen Clark said the Maori Party would be "last cab off the rank" when she went looking for partners.
Key now has the 70 confidence and supply votes he wanted, an impregnable position in a 122-member Parliament and the lines are firmly drawn.
On one side there is National, ACT, the Maori Party and Peter Dunne. On the other there is Labour and the Greens, with 52 votes between them.
So far so good, but it is only so far. There is a lot of unfinished business in the agreements, which are littered with taskforces, reviews and inter-party consultation groups.
They set up intriguing and potentially difficult relationships between associate ministers outside cabinet and ministers inside cabinet.
And in Maori Party co-leader Pita Sharples' case, he will be Minister of Maori Affairs outside cabinet with an associate minister inside cabinet.
As these relationships develop, a great deal of importance will attach to the "mutual respect and good faith" provisions in the agreement between National and the Maori Party.
If it ends in tears, both the parties will have failed. For that reason alone it is likely to work, the same way Labour's arrangement with New Zealand First worked for the last three years when opponents said it wouldn't.
In some ways it is the most complex government ever designed for New Zealand.
ACT's Rodney Hide, for example, will run a comprehensive outfit with numerous responsibilities. There is enough in the agreement's bullet points to keep him busy for the next three years, let alone the detail.
He gets the chance to do what he has been talking about for years -- cut red tape. A new title has been created for him, Minister for Regulatory Reform.
While he is doing that, he will also be a member of a leadership council and he will be working on ways to increase productivity.
National and ACT will work together to set up taskforces that will include private sector representatives and will "undertake fundamental reviews of all base government spending in identified areas".
John Key, who as prime minister will have overall responsibility for such initiatives, could find himself riding some wild horses.
And if the agreements do come to grief, it is likely to happen when ministers outside cabinet want to do things that the cabinet has told them they can't.
Then the buck stops with the prime minister. Key's inter-party diplomacy will be tested to the limit.
National's policy concessions haven't been equal between ACT and the Maori Party.
It has given away much more to the Maori Party, for the obvious reason that the differences were much greater than those between National and ACT.
National's policy to abolish the Maori seats has gone, replaced by an agreement that nothing will happen to them without the consent of the Maori people.
Maori representation in Parliament will be part of wider consideration of constitutional issues, which kicks the issue so far down the road it is out of sight.
The Foreshore and Seabed was more difficult. The Maori Party wants it repealed, that was the basis for its existence when it was formed.
To get round this, there will be a review of the way it is operating.
"In the event that repeal is necessary, the National-led government will ensure that there is appropriate protection in place to ensure that all New Zealanders enjoy access to the foreshore and seabed, through existing and potentially new legislation," the agreement says.
There could eventually be some dissent over the first seven words of that paragraph -- how will it be decided whether repeal is necessary?
But neither Key and Hide nor Sharples and his co-leader Tariana Turia are pretending it's going to be easy.
Your Questions. Independent Answers.