Aung San Suu Kyi's National League for Democracy (NLD) has won a landslide victory in Myanmar after general elections on 8 November. It was the country's first national vote since a nominally civilian government was introduced in 2011, ending nearly 50 years of military rule. The NLD now has control of parliament and can choose the next president. The BBC explains the complexities behind the historic win.
Was the vote democratic?
That was the idea, but everyone accepts there were some pretty serious flaws. Observers said it was it was reasonably fair. Given what has gone before that was still significant progress.
Things did not get off to smooth start. In the run-up to the election campaign voter lists were published, and they have been shown to be woefully inadequate. Dead people have been listed, and many of those alive not included.
That was the idea, but everyone accepts there were some pretty serious flaws. Observers said it was it was reasonably fair. Given what has gone before that was still significant progress.
Things did not get off to smooth start. In the run-up to the election campaign voter lists were published, and they have been shown to be woefully inadequate. Dead people have been listed, and many of those alive not included.
Not all the seats in the Hluttaw (parliament) are up for grabs. The military-drafted constitution guarantees that unelected military representatives will take up 25% of the seats in the Hluttaw and have a veto over constitutional change. This is what the generals call "disciplined democracy".
Did we expect Aung San Suu Kyi's party to do so well?
Image copyrightAFP-Image captionThe NLD remains popular in many areas of Myanmar
No-one was sure how much support the NLD would get. There were no reliable opinion polls so the only precedents were the two previous occasions that the party's popularity has been put to the test: the annulled 1990 general election and the by-elections of 2012.
In 1990 the NLD won 392 of the 492 available seats, taking 52.5% of the national vote.
Fast forward 22 years and the NLD claimed 43 of the 45 seats on offer, accruing about 66% of the available votes, mainly in ethnic Bamar areas which suited the party.
This time round it quickly became clear that the NLD was on course for a historic victory over its rivals.
Then on 13 November the NLD was confirmed to have won the two-thirds of seats they needed to control both houses of parliament and choose the next president.
Meanwhile, the ruling military-backed Union Solidarity Development Party (USDP) had only 40 seats.
First-past-the-post (constituency based) electoral systems like Myanmar's make landslides more likely.
Take a look at 1990. The NLD won just over half of the popular vote which translated into nearly 80% of the seats.
This year's vote has two distinct battlegrounds: in central and southern areas where there is an ethnic Bamar majority, and in the regions along the country's borders, where smaller ethnic groups have localised dominance.
In the seven central and southern regions where the Bamar dominate, the NLD are set for a large win. Up for grabs are 291 seats, or 44% of the entire Hluttaw (parliament), and it's possible that the current ruling party the USDP will only win a handful.
But that wouldn't give the NLD an overall majority.
So the key battleground for the campaign became the minority ethnic states where 207 seats (31%) were contested
.
Image captionMyanmar's military still retains control of key government ministries
Parties based along ethnic lines were always likely to win most of the seats but even the small gains made by the NLD paved the way for an overall majority.
In the last year Aung San Suu Kyi has travelled frequently to these areas, acutely aware of how important they could prove.
One unknown was the impact of a hardline Buddhist movement, the Ma Ba Tha, in Bamar areas. For the last 18 months it has been running a nationalist campaign arguing that the country's Buddhist identity is under threat from Islam, and that the NLD is the party of the Muslims.
The monks have drawn large crowds, but the election was the first test of how deeply their message has resonated.
How will the next president be chosen?
Image copyrightAFP-Image captionPresident Thein Sein has not ruled out remaining in politics
Indirectly. The 2008 constitution sets out a complex process whereby the Hluttaw (parliament) chooses a president. Though the general election is in November it's likely to be March 2016 before this takes place.
Firstly the Hluttaw will divide into three groups: the elected representatives of the Lower House, the elected representatives of the Upper House, and the unelected army representatives.
Each group puts forward a candidate and then the three of them face a vote in a joint session, that includes all the elected and unelected representatives of both Houses.
The winner becomes president and the two losers vice-presidents.
What it means in practice is if the NLD want to be able to choose the next president they need their candidate to get the most votes in this joint session.
Could Aung San Suu Kyi become president?
Aung San Suu Kyi may well have lead her party to a landslide win but she can't become president. Article 59F of the constitution states that if one of your "legitimate children… owes allegiance to a foreign power" you are disqualified. That covers both Ms Suu Kyi's sons Kim and Alexander, who have British passports.
A crushing win in the election won't help either, as the unelected army representatives can still block attempts to change this clause. So barring a spectacular change of military heart, it won't be President Suu Kyi in 2016.
If not President Suu Kyi then who?
This is where the rumour mill goes into overdrive.
It was long assumed that an agreement was in place between Aung San Suu Kyi and the Speaker of the Hluttaw U Shwe Mann.
Image copyrightAFP-Image captionSpeaker Shwe Mann had been thought a contender for president, but has lost the support of the military
It would have been a grand deal bridging the divide between the military and Ms Suu Kyi. She would back him - in return for promises of constitutional change.
But Shwe Mann miscalculated and lost the support of the army. In August he was deposed from his position as the head of the ruling USDP in what was called a "soft coup".
Without military backing he was no longer such an attractive choice for Ms Suu Kyi - and he went on to lose his seat anyway.
So who then?
In an interview with Indian TV in early October, Ms Suu Kyi said that in the event of the NLD winning a majority she had a "civilian" candidate in mind for the top job.
In the same breath she stressed that she would still lead the government from parliament, effectively rendering the president a weak puppet.
A few possibilities have been mooted for that rather neutered job, but Ms Suu Kyi is keeping her cards close to her chest.
One possibility is Tin Oo, a former commander-in-chief of the Burmese army and a founding member of the NLD
.
NLD member Tin Oo has been touted as a presidential candidate - but says he's not interested
He's 88 and sharp for his age but would be a strange choice. In his favour is decades of loyalty to Ms Suu Kyi, a quality she prizes highly.
Another name that has been mentioned is Win Htein, a former military officer and close confidant of Ms Suu Kyi.
A relative youngster at 74, he's risked the scorn of hardline monks by speaking in defence of Muslims in his constituency of Meiktila. But his health is not thought to be good.
There are also rumours circulating that a deal has already been done: that Ms Suu Kyi was pre-warned of Shwe Mann's demise, and a proposal put to her.
That arrangement would see her back Thein Sein for perhaps another two years, with the promise that he would bring in constitutional changes.
Their relationship has deteriorated significantly since he persuaded her to run for parliament in 2012, so it is open to question whether she would trust him again.
Of course it may not end up in the NLD's hands. With a quarter of seats occupied by the army, an anti-NLD coalition only needs a third of the elected seats to control the destiny of the presidency but that is looking increasingly unlikely.
If that were to happen the most likely "army candidate" would be the current President Thein Sein. His face is on the front of the USDP campaign buses and all the signs are that he does fancy another term.
One rumour is that Thein Sein might be chosen as president before retiring within a year or two due to ill-health, to allow the current Commander-in-Chief Min Aung Hlaing to take over.
On 8 November the voters had their say, but the choice of president will be a backroom deal.
Just how powerful is the president?
Not as powerful as you might think.
Key security ministries (defence, home affairs and border affairs) are selected by the head of the army, not the president, and there can be no change to the constitution without military approval.
One of the themes of the last five years has been the emergence of the Hluttaw as an important political force.
It will become more vocal and assertive after this election and has the power to push through legislation against the president's wishes if it wants.
Reporting by Jonah Fisher in Yangon