Mitch McConnell is gifting something to every wavering Republican in the Senate — conservative and moderate alike — in the Obamacare repeal bill he unveiled Thursday. It might be just enough to get the bill passed.

The Senate majority leader has made his bet that if any health care plan can get 50 Republican votes in the Senate, it’s the one he has released after weeks of secret negotiations.

As soon as next week, Senate Republicans will take up a bill that keeps big chunks of Obamacare, though ratcheting it back, while also cutting the law’s taxes on the health care industry and the wealthy. It also overhauls the entire Medicaid program and ends Obamacare’s generous federal funding to expand it.

The bill is the product of weeks of negotiations overseen by McConnell, all of which took place outside the public eye. McConnell is working with a narrow margin for error; under the “budget reconciliation” process Republicans are using to avoid a Democratic filibuster, he can lose only two of the 52 Senate Republicans and still pass the bill.

McConnell had to bridge broad disagreements between the conservative and moderate wings of his conference. The bill, as released, seems to try to thread the needle, giving both sides some wins and some losses.

Now senators will have to decide whether it’s good enough to get their vote. Their seven-year pledge to unwind Obamacare hangs on the line.

Conservatives get Medicaid cuts and Planned Parenthood defunded

The biggest conservative policy win is arguably the fundamental overhaul of Medicaid’s financing, a generational entitlement reform in Paul Ryan’s words, which places a firm federal spending cap on the program for the first time. McConnell is also proposing a slower growth rate for those caps than even the House bill did, a change that senators like Mike Lee of Utah have been pushing for.

The bill also defunds Planned Parenthood for one year, a $500 million funding cut for the women’s health organization. Conservatives in the House have indicated that this was one of the most important issues to them. Both because of the budget reconciliation rules and because a number of moderate Senate Republicans oppose defunding, it wasn’t clear if McConnell would include it in his bill. But he has, likely because conservatives consider it a must-have.

Both policies are losses for Senate centrists and could put their votes at risk. Sen. Susan Collins (R-ME) has long said she supports Planned Parenthood — though she has indicated in recent days that she would want a vote to strip out defunding from the bill, not that she would oppose the final legislation if that vote failed.

On Medicaid, Sens. Rob Portman (R-OH) and Shelley Moore Capito (R-WV) have sought to protect the program from deeper cuts than the House bill. Portman, in particular, has been wary of lowering the growth rate for the Medicaid spending caps more than the House bill did.

They had asked for $45 billion over 10 years for the opioid crisis, to help offset the effects of the Medicaid cuts. But McConnell’s bill for now includes only $2 billion for one year.

Moderates get a gradual Medicaid expansion phaseout, and more of Obamacare stays

A bloc of moderate senators, led by Capito and Portman, have been fixated on the Medicaid provisions. They particularly wanted a more gradual rollback of Obamacare’s generous funding for Medicaid expansion, which covered millions of poor Americans.

They got it: The Senate gradually decreases the generous funding for Medicaid expansion over three years starting in 2021, though it does still bring that funding to an end. From there on, states would be allowed to keep expanded Medicaid, but they would have to pay more to do it. Several states have said they would end the expansion if the federal funding were decreased.

McConnell also ended up keeping big chunks of Obamacare to appease other centrist concerns, like providing more financial assistance for people with lower incomes and for people in high-cost areas to buy private insurance. The Senate bill maintains Obamacare’s subsidy structure, which factors in both those issues, but reduces the size of the subsidies.

Finally, the Senate bill doesn’t directly undo Obamacare’s insurance protections, another nod to moderate concerns, though it does make it easier for states to waive them.

Conservatives will have to accept the more gradual Medicaid expansion phaseout and not getting more rollback of Obamacare’s insurance regulations. Senators like Ted Cruz of Texas have said lowering premiums is their first priority, and they believe unwinding the regulations are essential to doing that. They have to swallow the reality that much of the health care law’s infrastructure will remain in place.

The most ideological Republicans, like Sen. Rand Paul of Kentucky, have also said they would oppose federal dollars paid to health plans to stabilize the insurance market in the next few years. The Senate bill does include that money.

Everybody gets big tax cuts

One area where Republicans were relatively united was on cutting taxes. The Senate bill repeals almost every major Obamacare tax without delay.

The House bill had repealed $660 billion of the law’s taxes over the next 10 years. There had been a debate in the Senate about delaying the repeal of some of those taxes, to help pay for provisions in Medicaid and the private market. But the Senate seems to have decided to instead cut Medicaid more deeply and roll back the financial assistance for private coverage.

So the Senate bill makes Obamacare less generous, cuts taxes, and cuts Medicaid. It gives both ends of the Senate GOP spectrum some wins, but also hands them some losses. The question for McConnell is whether 50 of his 52 members will decide that’s good enough for them. Or what can be done in the next week, before the expected vote, to win over any wavering senators. McConnell is said to be pushing for a vote in part to pressure his members to get in line and back the bill despite any misgivings.

As they left Thursday’s meeting where they were briefed on the bill, most Republicans said they were still undecided. They still needed to read the bill.

“Obviously, we’ve got a lot to look at,” Sen. Lisa Murkowski (R-AK), one of the key swing votes, said as she stepped into a Capitol elevator.