The Senate passed the “Tax Cuts and Jobs Act,” a massive overhaul of the tax code, 51-49 at 1:50 am Saturday morning, bringing Republicans even closer to delivering President Donald Trump a tax bill by the end of the year.

The bill was pieced together in the final hours, with last-minute tweaks and sweeteners put in to convince enough holdout Republican senators to vote “yes.”

In all, the Senate’s tax plan permanently cuts the corporate tax rate from 35 percent to 20 percent, repeals Obamacare’s individual mandate, estimated to leave 13 million fewer insured over the next decade, and lowers tax rates for most Americans until 2026, overwhelmingly advantaging the country’s wealthiest.

The bill also alters the state and local tax deduction — completely repealing the income tax deduction and capping the property tax deduction at $10,000 — a last-minute addition to win over Sen. Susan Collins (R-ME). It also gives a 23 percent deduction to pass-through businesses, which are companies organized as sole proprietorships, partnerships, LLCs, or S corporations that don’t pay the corporate income tax, a demand from Sens. Ron Johnson (WI) and Steve Daines (MT).

Only two amendments passed in a late-night vote-a-rama that went until 1:30 am — one of those amendments was from Democrat Sen. Jeff Merkley (OR), which stripped out a provision from Republican Sen. Pat Toomey that gave colleges that don’t accept federal funds like conservative Hillsdale College, a favorite donation target of Education Secretary Betsy DeVos, a special tax carveout.

More so than the last-minute changes, the Senate tax bill’s passage is a story about Republicans learning to forget their longstanding concern about the national debt and vote on a bill that the Joint Committee on Taxation’s last estimate says will add about $1.4 trillion to the deficit, or, when adjusted for economic growth, approximately $1 trillion.

“We’re depending on the economy to spring back,” Majority Whip Sen. John Cornyn (R-TX) said.

Republicans are banking on their intuition that massive tax cuts for corporations and the upper class will bring back jobs and investments, to grow the economy at historic rates. And if they’re wrong?

“If I’m wrong, we’ll pay a price. If I’m right, it will make sense,” Sen. Lindsey Graham (R-SC) told reporters.

How Republicans learned to forget about the deficit to pass tax reform

Late Thursday night, four senators were threatening to vote against the tax bill. By midday Friday, three were on board, giving leadership enough votes to pass the bill.

Daines and Johnson were calling for more tax breaks for pass-through businesses, and Sens. Jeff Flake (AZ) and Bob Corker (TN) had expressed deep concerns about the bill’s impact on the deficit.

Then in some late-night negotiations, Republican leaders picked off the votes they needed to get a win. Daines and Johnson got an increase to the deduction for pass-throughs from 17.4 percent to 23 percent. Flake finally said he would vote for the bill after getting assurances from leadership that his immigration policy priorities would be addressed in a deal on the Deferred Action for Childhood Arrivals program.

It was clear Corker would stand alone in his grievances about the bill’s deficit impact.

Corker’s efforts to negotiate some kind of deficit fix — both the proposed “trigger” that would prompt tax increases if the economy didn’t perform as expected, and outright tax increases — were left in the dust. Instead, Republicans are rallying around their hope that economic growth will increase and that their tax plan will pay for itself.

As Jim Tankersley wrote for the New York Times, “so far, every so-called dynamic analysis that scrutinizes the full details of the bills and factors in economic growth finds that those plans would add at least $500 billion and as much as $1.7 trillion to the deficit.”

Despite all this, Republicans are ignoring the numbers, still confident that their plan will pay for itself.

“I am highly confident,” Graham said. “The CBO says the economy is going to grow at 1.9 [percent] over the next 10 years — if we can get to 2.2, there is no deficit.”

Now the House and Senate have to pass the same tax bill

With the bill passed in the Senate, it’s time for both chambers of Congress to come together to hash out the differences between their bills.

Because despite months of negotiations between top House and Senate members and members of Trump’s administration — a working group dubbed the “Big Six” — Republicans in the House and Senate came out with two drastically different bills.

House and Senate leadership have made it clear that they intend to go to conference committee with the bills, a formal process in which each chamber nominates members to be their negotiators to put together a hybrid of the two tax bills.

With such a slim margin in the Senate, this is going to be a tricky business. And there are some rules: Those on the committee “may not change a provision on which both houses agree, nor may they add anything that is not in one version or the other,” according to the Congressional Research Service.

The final product is a “conference report,” which is passed by the majority of the members in the conference committee and then sent to the full House and Senate floors. Both the House and Senate have to pass the conference report outright for it to be sent to the president’s desk.

There are some timing issues that could impact this process. Collins told reporters Tuesday that if she is going to vote on the Senate’s tax bill, she wants to see two Obamacare stabilizations bills passed before the conference report comes out.

So while the Republican tax plan just cleared a major hurdle, it’s not over the finish line just yet.