PROTECTING the air, let alone improving it, is a challenge. America was reminded of that last month, as courts handed federal regulators two setbacks in as many weeks. On August 13th a federal appeals court ruled that the Environmental Protection Agency (EPA) had overstepped its authority in rejecting a plan Texas had devised in 1994 for curbing emissions. And on August 21st a different appeals court struck down the EPA's cross-state air pollution rule, a 2011 measure designed to protect states from pollutants emitted by coal- and natural-gas-fired power plants in neighbours upwind of them. Both conflicts were almost inevitable. The 1970 Clean Air Act gives the federal government the right to set air-quality standards and emissions limits. The states, however, retain the right to decide how they will meet those standards, and may also set stricter standards of their own. That led to the first case. Texas (unsurprisingly) did not feel moved to be especially strict, and it took the opportunity to devise its own programme for reducing emissions. The state's flexible permit system required power plants and certain other polluters to reduce their overall emissions, but left them considerable latitude over how to get there. The idea was to help businesses contain costs. In 2010 the EPA announced that the scheme did not pass muster. It left too much to chance, and was too hard to enforce. That ruling itself has now been overturned. The second case also involved the Clean Air Act's uneasy federalism. The states are resigned to being responsible for their own emissions, but they are assessed on the quality of the air itself, even if some of the emissions present have sneaked across the border. The federal law includes a "good neighbour" provision, but it also emphasises the autonomy of the states. Some states have co-operated with each other, even without the federal government telling them to do so. Voluntary efforts, however, may not go far enough and cannot be enforced. In 2008 the EPA issued the cross-state air pollution rule to revise a 2005 regulation that had also been challenged in court. The new rule required about half the states to reduce their emissions of sulphur dioxide, nitrogen oxide and other emissions based on projections of how many pollutants were crossing state lines, and told them how to do it. The states affected argued that this was an unfair burden. The EPA had estimated the cost of the new rule at $800m in 2014, the year the emissions standards were officially meant to take effect. The appeals court agreed that the EPA's new rule was too bossy, and federal law trumps it. Despite these setbacks, however, the environmentalists should not be wholly bereft. By the time the EPA lost the court case in Texas, for example, it had already achieved its immediate goal. Elena Craft, a health scientist with the Environmental Defence Fund's Austin office, points out that since the EPA had rejected the Texas scheme, and no one had expected the court to second-guess the agency, the Texas plants had all complied anyway. Worth noting, too, is that in both cases the plaintiffs were complaining about authority and expenses. None was disputing the premise that pollution is bad. This seems to be a public consensus. In a survey published by the American Lung Association in March 2012, three-quarters of respondents said that protecting air quality was "extremely" or "very" important. The Clean Air Act itself was more popular than Congress, Barack Obama and, for that matter, the EPA.