AMERICA’S health-care system is the costliest in the world, gobbling up 17% of GDP. The average for rich nations is only 9%; even the French spend less than 12%. Despite this avalanche of cash, one American in ten has no cover and American life expectancy, at 79, is four years worse than Italy’s. The Affordable Care Act of 2010, better known as Obamacare, was supposed to deal with these problems. Five years later, Barack Obama’s most important domestic reform is unpopular (56% of Americans disapprove of it) and under renewed attack. This week the Supreme Court heard yet another legal challenge. In King v Burwell, the law’s opponents argue that its subsidies for individuals buying health insurance on the federally organised online exchanges are illegal (see article). They are unlikely to prevail but, if they do, the law will be gutted and the insurance market thrown into turmoil.

That would be a terrible shame, for Obamacare appears to be working better than expected. First, despite the incompetent rollout of healthcare.gov (the website that allows people to use the federal exchanges), the proportion of Americans who lack cover has fallen from 16.2% to 12.3% since 2009. Second, the previously terrifying pace of medical inflation has slowed. The amount that America spends on health care grew by 3.9% a year in nominal terms between 2009 and 2011—having grown by 7.3% a year in 2000-08. The trillion dollar question is: how much of this squeeze is because of Obamacare?

Not all, clearly. The economic downturn accounted for much of the fall in health-care inflation: 77% by one estimate, 37% by another. Yet Obamacare also played its part. For one thing, it may have helped trim some of the fat from Medicare, the bloated public-health scheme for the old. Many hospitals appear to have changed the way they behave in anticipation of the law. The old rule of thumb for American health care—and particularly for Medicare—was that doctors were paid for every test and surgical procedure, and so performed many that were unnecessary. The new law has provisions that encourage them to keep people well; for example, it imposes penalties on hospitals where patients are frequently readmitted. Hospitals are merging, streamlining and restraining their enthusiasm for buying all the latest expensive equipment (see article). A new paper in Health Affairs shows that they have improved productivity in the past decade, and especially since 2009.

Annual spending per Medicare beneficiary has fallen in real terms from $12,000 in 2011 to an estimated $11,200 in 2014. This is highly unusual—the last time Medicare spending fell was in the late 1990s. Granted, Medicare beneficiaries are healthier than they were, since swarms of baby-boomers have pulled down their average age. But the programme has also grown more efficient. The Congressional Budget Office projects that Medicare spending per head will be no higher in 2020 than it is now. By then, spending on Medicare and Medicaid (cover for the poor) could be $160 billion a year less than previous estimates. In the wider market, too, health inflation is subdued (see article).

Plenty more flab to trim

As Americans age and Obamacare continues to extend coverage, federal outlays on health will probably start to grow again as a share of GDP over the next decade. America still spends far more than it needs to on health care, as the gap with other nations shows. But there is hope at last that health inflation can be made more manageable. Scrapping Obamacare and starting again from scratch would make this harder. Far better to build on what appears to be working. For the Supreme Court to rule for the challengers would be a woeful outcome.