LONDON (Reuters) - Legislation underpinning the government s plan to leave the European Union passed the latest stage in its journey through parliament on Wednesday, but still faces weeks of scrutiny before it becomes law. After eight days of debate, the legislation completed its  Committee Stage , where lawmakers debate the bill line by line and try to make changes to the government s proposed wording. Formally known as the European Union (Withdrawal) Bill, the legislation will now face other stages of approval in the lower house of parliament, and must then make its way through a multi-stage process in the upper house.  Both chambers must agree on the wording before it can become law. What is the bill and what does it do? The legislation serves two main functions: 1. Repealing the 1972 European Communities Act which made Britain a member of the European Communities, forerunner to the European Union. This effectively ends Britain s EU membership. 2. Transferring the existing body of EU law into British law. This is designed to provide legal certainty about the complex process of leaving.  Why is it controversial? The bill has faced criticism from opposition lawmakers, campaign groups and members of May s Conservative Party. Brexit is still divisive in Britain after a referendum in June last year, and many people, including some lawmakers, want to retain as much of the country s current EU membership as possible. Others would like to reverse the vote altogether. The most significant objections so far have focused on several different parts of the bill: 1. The power for the government to amend EU laws as they are brought onto the British statute book.  2. The extent to which parliament will be given a say on the final exit deal. 3. The government s intention to fix March 29, 2019 in law as  Exit Day . May runs a minority government, which has a slim 13-seat working majority in the 650-seat parliament thanks to a deal with a small Northern Irish party. Only seven Conservative lawmakers could be required to rebel to defeat the government. What has happened so far? The threat of rebellion has forced the government to make several concessions on its plans, including Wednesday s compromise to allow the date of Brexit to be changed in exceptional circumstances. Ministers also agreed to greater scrutiny in parliament of the process of transposing EU law. May suffered one embarrassing defeat, when 11 Conservatives sided with the opposition to successfully demand stronger guarantees that parliament will have a meaningful vote on the country s final exit agreement. Ministers fought off, or bargained their way out of other disagreements on issues like the powers government will have to change EU laws as they are transposed into British law, and the government s intention not to transfer across the EU s Charter of Fundamental Rights. The bill cleared its first parliamentary hurdle in September when, after two days of debate, lawmakers voted 326 to 290 in favor of the principles of the bill.  What happens next? The debate will continue in the lower house of parliament next year at a date which has yet to be set. This so-called  Report Stage  is a new opportunity to add amendments. Immediately after report stage, the bill is given a  Third Reading . It usually lasts an hour and is a general discussion of the bill followed by a vote. No amendments can be made. If approved, the bill will then pass to the upper chamber of parliament, where the Conservatives do not have a majority. The entire process will take months to complete, and there is no target end date. House of Lords:  Once the bill passes to the unelected upper chamber of parliament, the House of Lords, Lords can put forward their own amendments, each of which will be discussed and decided on in turn. If the lords agree to any amendments, the bill passes back to the House of Commons for its approval. Ping Pong: If the bill passes back to the commons, they debate and vote on the lords  amendments. No new amendments can be introduced. In theory the bill can continue passing back and forth between the lords and commons until the final bill is agreed upon. Royal assent: Once the bill has been agreed by both houses of parliament, it is given royal assent, when the queen formally agrees to make the bill into an Act of Parliament. 
Factbox: May's Brexit plan passes parliamentary test, more to come