Surprises still possible in Irish presidential election
As voting finishes in the Irish presidential election, BBC Ireland correspondent Mark Simpson looks at the possible outcomes.
If the Dublin bookmakers have got it right, the ninth president of Ireland will be the former government minister Michael D Higgins.
He is the ultimate safe pair of hands - a softly-spoken, bespectacled intellectual from the Irish Labour Party, which is part of the ruling coalition government.
However, the final opinion polls of the campaign pointed in a completely different direction.
They suggested that businessman Sean Gallagher - a star of Ireland's version of the TV show Dragon's Den - would win the election quite comfortably.
In the last opinion poll, in the Irish Times, he received 40% of the vote, putting him well ahead of his nearest rival, Higgins, who was on 25%.
Sinn Fein's Martin McGuinness was back in third place, on 15%.
So why have the bookies gone for Higgins?
The simple answer is that Gallagher had a TV nightmare in the final televised debate on Monday evening.
He looked weak, he stumbled over his words and looked anything other than presidential.
It led to his campaign being likened to Devon Loch, the race-horse involved in a spectacular fall just before the winning post in the 1956 grand national.
As Gallagher left the RTE studio after Monday night's dramatic debate, he looked like a man who had just gone from hero to zero.
However, some political pundits say his lead was so substantial, he may just hang on for victory.
One respected Dublin newspaper journalist was overheard saying: "I still reckon Gallagher will win ... by half a vote."
The election may well boil down to vote transfers.
It is highly unlikely that any of the seven candidates will get elected on the first count.Rollercoaster
They will require more than 50% of the vote and no-one got even close to that figure in any of the opinion polls.
Under the single transferable vote system, the candidate with the lowest amount of votes will be eliminated after the first count and their votes transferred, according to the preferences stated on the ballot papers.
Much attention will be paid to the performance of Martin McGuinness.
He had a bruising election campaign, with the media spotlight fixed firmly on his IRA past.
His insistence that he left the IRA in 1974 led to repeated questioning about whether he was telling the whole story.
As one commentator put it, the main issue was not his relationship with the IRA in the past, but his relationship with the truth in the present.
Nonetheless, McGuinness went down well on the doorsteps. His ground campaign was much better than his air campaign.
He kept his cool, even when confronted by the angry son of an IRA victim.
When it came to the TV debates, he was arguably the star performer.
Sinn Fein will be hoping for around 20% of the vote.
That would be double what they achieved in this year's Irish general election.
Anything over 15% would be a decent result.
Anything over 20% would be a triumph.
Some within the party are still saying they think McGuinness can win the election, but it would take a remarkable last-minute surge for that to happen.
The most likely scenario is that McGuinness's transfers decide whether Higgins or Gallagher wins.
He may not like the term kingmaker, but that is what the Sinn Fein candidate could well become.
As for the others, the campaign of independent Senator David Norris was dogged by controversy and in spite of leading the opinion polls at one stage, his chances of victory seem to have gone.
It has been an eventful contest in many ways, not least the surprisingly poor performance of the Fine Gael candidate Gay Mitchell.
As a member of the most popular party in the country, he was expected to win.
Instead, opinion polls suggest he is likely to be among the also-rans.
The former Eurovision song contest winner Dana, and independent candidate Mary Davis, seem set for a similar fate.
The bookies say the top four will be Higgins first followed by Gallagher, McGuinness and Norris, in that order.
However, after so many many twists and turns in a rollercoaster four-week campaign, there may be one last surprise.