When congressional Republicans tried to repeal Obamacare, Mitch McConnell compared the challenge to solving a Rubik’s cube — and he ended up stumped.

Now, GOP leaders have taken up the cube yet again as they try to solve the fiendishly difficult legislative puzzle of tax reform.

The party’s politicians, experts, and activists have long been more animated by the tax issue than by health care, so it would seem simple to unite them around one bill.

But even before a bill has been drafted, challenge after challenge has come up, endangering the entire endeavor. And without a specific bill to defend, “Right now, they’re fighting both real and imaginary enemies,” says Douglas Holtz-Eakin of the American Action Forum, a nonprofit promoting the GOP effort.

Republicans have two main goals when it comes to taxes. They want to make major, permanent changes to the corporate tax code, overhauling how it’s structured in what they hope is a pro-growth way. And they also want to cut taxes — for corporations generally, for individual taxpayers, and for wealthy estate owners.

The dream formula for getting this done has always been to pair general tax rate cuts with the elimination of deductions, loopholes, and other benefits (which is often referred to as “broadening the base”). That helps politically by creating many “winners” from the legislation. It cushions the impact on the deficit somewhat by at least somewhat making up for lost revenue with all that loophole-closing.

The trouble is, well ... they have to get rid of all those deductions, loopholes, and benefits, in the face of inevitable furious lobbying from the people and businesses that currently benefit from them.

“It’s the usual tax reform war,” says Holtz-Eakin. “Which is, ‘We like this good news, the lower rates, but we really don’t like this bad news — the broader base.’”

If more deductions are kept intact and the tax base isn’t broadened, the GOP bill will have a tougher time satisfying deficit hawks and abiding by Senate rules. And politically, Republican politicians have so uniformly campaigned against any and all tax increases for so long that any bill that raises taxes on anyone — even if it’s just by ending deductions — will be tough for many of them to support.

So in recent weeks, problem after problem on these fronts have emerged. The GOP framework’s attempt to raise revenue by ending the state and local tax deduction has come under fire from many in the party. Sen. Rand Paul (R-KY) flagged estimates that Republican leaders’ plan will raise taxes on many in the middle class. Retiring Sen. Bob Corker (R-TN) is threatening to vote against any plan that raises the deficit by even a penny, and Senate rules constrain what any bill that doesn’t raise significant revenue in the long run can do.

It’s at least theoretically possible that all these problems will be solved, or at least fudged sufficiently to get a bill passed. But uniting 218 House members and 50 senators around any one proposal will be a challenging task indeed.

Problem 1: Many Republicans are blanching at what seemed to be their easiest revenue raiser

So far, the GOP has mostly avoided specifics about how they’ll pay for the tax cuts they want. What they’ve mainly done is promise to end various unspecified deductions and loopholes, for both individuals and corporations, while avoiding pesky specifics.

There’s one exception to this vagueness, though — Republicans have made clear they want to raise a great deal of revenue by getting rid of the state and local tax deduction (which has the fun acronym of SALT).

Taxpayers in blue states like New York, New Jersey, and California tend to benefit the most from this deduction, because they tend to have both higher taxes and richer residents. So since the pain of a tax hike would fall mainly on states and areas represented by Democrats, Republicans would theoretically be able to stick together and keep it in the bill.

But there were always many problems with this theory. When it comes to the House, the districts with the greatest share of taxpayers who take the state and local deduction are about equally split between Republicans and Democrats, a Tax Policy Center analysis shows. Some of those Republicans are viewed as vulnerable in 2018 and some aren’t, but most of them are sure to blanch at the possibility of a tax hike that would disproportionately hit their own districts.

The frenzied lobbying to kill this provision will go beyond taxpayers themselves. “Most state and local government officials, including Republican governors, are likely to oppose that change,” economist Tyler Cowen recently wrote at Bloomberg View. “Lobbies connected to schools, prisons and local infrastructure — by no means all left-wing groups — will scream.”

Unsurprisingly, then, Republicans’ agreement to repeal the SALT deduction is already falling apart. As Bloomberg’s Sahil Kapur reports, many House Republicans are already talking with GOP leaders about proposals to just limit it rather than end it entirely. And the White House has also recently signaled that they’re flexible on the topic.

This is no minor matter — much will hinge on what Republicans decide will happen to the state and local tax deduction in their bill. The Tax Policy Center found that a full repeal of it would raise $1.3 trillion in revenue over the next decade. That is a lot of money that the GOP really hoped to use to help pay for tax cuts elsewhere, and if they lose it, they’ll have to either give up some of those cuts or their deficit problems will get even worse.

Problem 2: Republicans are really, really not going to want to support anything that looks like tax hikes on middle-class Americans

This is a GOP tax plan? Possibly 30% of middle class gets a tax hike? I hope the final details are better than this. https://t.co/lcjkI4YRz8 — Senator Rand Paul (@RandPaul) October 2, 2017

On Monday, Sen. Rand Paul (R-KY) sent a shot across GOP leaders’ bow by incredulously tweeting a link to a report that their tax reform framework could end up raising taxes on many in the middle class.

This report, from the Tax Policy Center, finds that according to what we know is in the plan so far, “by 2027, taxes would rise for roughly one-quarter of taxpayers, including nearly 30 percent of those with incomes between about $50,000 and $150,000.”

Part of this is because of the aforementioned repeal of the state and local deduction. But another part of it, per the TPC, is because the framework “would replace personal exemptions, which are indexed for inflation,” with other new credits that are not indexed for inflation. As a result, they write, “the number of taxpayers with a tax increase rises over time.”

Though Paul has often opposed GOP bills from the right, this is one on which his critique will likely be squarely within the mainstream of Republican opinion. If there’s one thing practically every Republican will say they stand for and openly campaign on, it’s tax cuts. Convincing them to cut taxes for corporations and the top 1 percent is one thing. But convincing them to raise taxes on many middle-class taxpayers while doing that will be a much tougher sell.

Aparna Mathur, an economic policy scholar at the American Enterprise Institute, expects that Republicans will try to make the case that middle-class taxpayers will in fact benefit from the corporate tax cuts, because of higher wages. “This whole question about who really bears the corporate income tax burden I think is very, very critical for pushing forward on this legislation,” Mathur says. But she argues that while there is empirical research suggesting that corporate tax cuts will likely translate into higher wages, “It’s hard to convince people that’s going to happen.”

One potential path forward would be to throw in more tax credits for more middle-class people — for instance, by expanding the child tax credit yet further, as Sens. Marco Rubio (R-FL) and Mike Lee (R-UT) reportedly want. But of course, that again would worsen the bill’s deficit math. Which leads us to...

Problem 3: The less revenue Republicans can raise, the more they’ll run afoul of deficit hawks

If Republicans’ problem was only that their proposals to raise revenue was unpopular, the solution would be pretty easy — they could just craft a bill that blows up the deficit instead of raising much revenue. That is, after all, basically how President George W. Bush passed two tax cut bills in his first term.

But there are two big reasons that’s not so easy to do this time.

First, the current deficit is much bigger now (Bush actually had a surplus for his first tax bill), and some Republicans who care about deficit-cutting aren’t so eager to just blow it up more.

The most vocal of them so far is Sen. Bob Corker (R-TN), who recently announced that he’s retiring in 2018. Corker has said repeatedly in recent days that he won’t support a bill that adds even “one penny to the deficit.” He complained that since winning in 2016, Republicans had “entered a party atmosphere” in which they no longer cared about the deficit, which he called “the greatest threat to our nation.”

Now, Corker has left a bit more wiggle room than the “one penny” language might suggest. For instance, he’s suggested that he might accept “a reasonable score on dynamic growth,” meaning that he’s basically willing to assume the tax cuts will generate significant revenue by stimulating economic growth.

Problem 4: The less revenue Republicans can raise, the more they’ll run afoul of Senate rules

The second reason blowing up the deficit isn’t an easy answer for the GOP is that the deficit impact of the bill also constrains what they can do with it — because of Senate rules.

That’s because Republicans are considering tax reform under the special budget reconciliation process, which lets them avoid a Senate filibuster and advance a bill with a simple majority. And this process comes with a major trade-off — the bill can’t add to the deficit after 10 years.

President Bush, who was mainly focused on cutting taxes rather than permanent tax code reforms, solved this problem by writing his tax cuts so that they’d “sunset,” or expire, after 10 years. And to some extent, Republicans will likely do the same this time around.

This GOP, however, also has grander ambitions to permanently reform much of the tax code. And it makes much less sense to restructure the corporate tax code, but then set that new tax code to expire. “It would make no sense to move to a territorial system and have it sunset after eight years. That would be lunacy,” Holtz-Eakin tells me.

Yet this brings the party back around to the exact same problem. As currently written, the corporate tax changes alone in their framework would cost more than $4.1 trillion from 2028 to 2037, the Tax Policy Center estimates. If the party wants to actually enact those changes, somewhat rosier “dynamic scoring” numbers won’t be anywhere near enough to make those numbers work out — they’re going to have to come up with a whole lot of revenue.

Problem 5: A partisan bill means they have very little room for error

Finally, though the GOP has made some noises about reaching out to Democrats on this bill, they’ve shown little interest in making the serious compromises that would be required to win significant support from across the aisle. So the crux of their strategy remains passing a bill with almost entirely (or entirely) Republican votes, through budget reconciliation, as they tried with Obamacare repeal.

But that means they have very little room for error — they can only lose around 24 votes in the House and, once again, three in the Senate, before their bill will fail.

That could put the process at the mercy of many lawmakers’ demands or even whims. Knowing their votes are necessary, Republican members of Congress could start demanding to ensure that their own states or constituents won’t lose out from the legislation — or that existing perks be preserved. Others could make policy or process demands. And with GOP leadership so desperate for some — any! — legislative win, holdouts really could have leverage to force some concessions.

Additionally, while a tax cut bill that pleases everybody might be relatively easy to pass along party lines, a broader tax reform bill that creates losers is more challenging to do that way. The 1986 tax reform bill was a bipartisan effort, with lawmakers essentially agreeing to share the political pain for taking away tax breaks certain interests love. The GOP will likely have no such cover here.

All this is why many in Washington have speculated that the GOP will eventually scale back their grand reform ambitions in favor of passing a simple, popular, temporary tax cut. In the end, they may. But for now, they’re still working away at trying to solve their tax reform Rubik’s cube.