Brexit: What happens now?
New UK Prime Minister Boris Johnson says he plans to renegotiate the Brexit deal agreed with the EU by his predecessor Theresa May. He says he is committed to leaving on 31 October come what may.
That does not mean we can be certain about what will happen. There are still many possible outcomes.
Mrs May's deal with the EU had two main elements - a binding withdrawal agreement (on the terms of the UK's departure) and a non-binding political declaration (on the shape of the long-term future relationship). The deal was resoundingly rejected by MPs.
Mr Johnson's plan is to negotiate with the EU to remove the Northern Ireland backstop from the withdrawal agreement (WA). The backstop was designed to ensure there could be no return to a hard border on the island of Ireland. (It would keep the UK in a customs union with the EU if there is no free trade agreement that avoids a hard border ie physical infrastructure and checks on goods.)
Mr Johnson would also like changes to the political declaration.
The difficulty is that up to now the EU has consistently said it will not reopen the withdrawal agreement, although the EU is open to changes to the political declaration. Mr Johnson insists they will reconsider now it is clear that the British government is prepared to leave without a deal. And he says that the backstop is unnecessary to prevent a hard border.
Another factor is time. Nothing much is usually done in Brussels during August, and the new European Commission does not take office until 1 November.
Mr Johnson is determined that Brexit should happen on 31 October, even if a new deal has been agreed in principle but not ratified and brought into law. In those circumstances there would almost certainly be questions about whether a short delay was sensible.
Perhaps the biggest question, though, is what would happen if no new deal is negotiated - or if MPs reject whatever new deal is brought back.
1. No deal
No-deal Brexit is still the default outcome if MPs cannot agree anything else and there are no further extensions. The deadline is 31 October.
It would also be possible for MPs to back a no-deal Brexit, although there has been a majority against that option when they have voted on it before.
There has been considerable discussion about whether MPs would be able to stop no deal if the new prime minister was determined to press ahead.
It has been suggested Mr Johnson could prorogue Parliament to let a no-deal Brexit happen. Proroguing effectively means Parliament is shut down - there would be no debates or votes.
In July, MPs and Lords voted for a measure that attempts to stop Parliament being closed down.
If MPs did want to oppose no-deal Brexit and did get a chance to do so, their ultimate weapon would be ousting the prime minster through a confidence vote.
2. Another no-confidence vote
Theresa May's government survived a vote of no confidence on 16 January by 325 votes to 306. Labour could table a no confidence motion in the new government at any time.
Under the Fixed Term Parliaments Act 2011, UK general elections are only supposed to happen every five years. The next one is due in 2022.
But a vote of no confidence lets MPs vote on whether they want the government to continue. The motion must be worded: "That this House has no confidence in Her Majesty's Government."
If a majority of MPs vote for the motion then it starts a 14-day countdown.
If during that time the current government or any other alternative government cannot win a new vote of confidence, then an early general election would be called.
That election cannot happen for at least 25 working days but the precise date is set by royal proclamation on the advice of the prime minister. So the election could come after Brexit has happened if there's no further delay.
3. Request a general election
A vote of no confidence isn't the only way to bring about an early election. It could be that Boris Johnson decides it's his best way forward.
The prime minister does not have the power just to call an election. But, as in 2017, Mr Johnson could ask MPs to vote for an early election under the terms of the Fixed Term Parliaments Act.
Two-thirds of all MPs would need to support the move. The earliest date for the election would be 25 working days later but it could be after that - the prime minister would choose the precise date.
4. Another referendum
A further possibility is to hold another referendum.
It could have the same status as the 2016 referendum, which was legally non-binding and advisory. But some MPs want to hold a binding referendum where the result would automatically take effect - like with the 2011 referendum on changing the voting system for UK general elections.
One widely discussed option would be for a "confirmatory vote" - where the public would be given the choice between accepting a deal or remaining in the EU.
Others argue that any further referendum should have the option of leaving the EU without a deal.
Either way, a referendum cannot just happen automatically. The rules for referendums are set out in a law called the Political Parties, Elections and Referendums Act 2000.
There would have to be a new piece of legislation to make a referendum happen and to determine the rules, such as who would be allowed to vote.
It could not be rushed through, because there has to be time for the Electoral Commission to consider and advise on the referendum question.
The question is then defined in the legislation.
Once the legislation has been passed, the referendum could not happen immediately either. There would have to be a statutory "referendum period" before the vote takes place.
Experts at University College London's Constitution Unit suggest that the minimum time for all of the required steps above is about 22 weeks. That already takes us beyond 31 October.
5. Cancel Brexit
The European Court of Justice has ruled that it would be legal for the UK to unilaterally revoke Article 50 to cancel Brexit (without the need for agreement from the other 27 EU countries).
It is not totally clear what the process would be. But an act of Parliament calling for Article 50 to be revoked would probably be sufficient.