Between 2005 and 2016, 334 coal-fired power plants in the U.S. shut down as natural gas increasingly fed the grid. While natural gas has its own problems as an energy source (and won’t get us the emissions cuts we need to halt global warming), it does have an edge on coal when it comes to pollutants. A new study in Nature Sustainability puts numbers to that edge, estimating that thousands of lives and millions of bushels of crops were saved thanks to those coal plant closures.

Carbon dioxide is a global pollutant—every individual power plant around the world contributes to the rising concentration of the gas in the atmosphere, warming our planet. But fossil fuel-powered plants also release pollutants that harm their local environment. Fine particulate matter, an array of tiny particles less than 2.5 micrometers in diameter, and ozone gas form from the smoke rising from these plants. Both are known to be harmful to our respiratory systems. Ozone can also wither crops by causing tissue damage when it enters leaves. For decades, numerous studies have tracked the effect of these pollutants on both human and plant health, but few linked those pollutants directly back to power plants.

Jennifer Burney, an environmental scientist at the University of California San Diego, was interested in doing just that. “There’s a lot of studies that look at changes in concentrations of pollutants,” says Burney. “But those are often not able to connect back to tangible policy or technology changes that caused those situations, so they tend to lack a punch.” She adds that it’s more powerful to be able to say power plants caused the pollution-related deaths, as opposed to just blaming pollution generally.

The coal plant closures across the country gave Burney an opportunity to illuminate those pollution-caused impacts. She used satellite and ground-based measurements of pollutants from 2005 to 2016, as well as county-level information on mortality and crop yields. By performing a statistical analysis of the power plant sites, she could see how the shifts affected air quality and, in turn, lives and agriculture. “It’s a really solid paper and a really cool analysis that she was able to do observationally and statistically, rather than doing the modeling approaches that get used frequently to do this kind of thing,” says Jonathan Buonocore, an environmental health researcher at Harvard who was not involved in the study.

Health and agriculture significantly improved when coal power left a county. Based on the analysis, the shutdown of coal plants across the country between 2005 and 2016 saved 26,610 lives. On average, the closing of a single coal-powered facility led to a 0.9 percent reduction in county-wide mortality.

In addition to human lives, the shutdowns saved approximately 570 million bushels of corn, wheat, and soybeans in nearby fields (that’s around two million dump trucks worth of grain and beans). While her main analysis was confined to the counties with coal plants, Burney estimates in her study that if you consider pollutants travelling as far as 200 kilometers away from a plant, closing those power stations actually saved 38,200 lives and 4.8 billion bushels of food. “The results that she got are fairly consistent with the results from modeling studies,” says Buonocore. This underscores the threats posed by coal. “If you take two different approaches to answering your question and get pretty similar answers, then that’s a good sign that your answer is robust.”

While the benefits of cutting coal are heartening, that’s not the whole story—a lot of that power was replaced by natural gas (though the new gas plants are generally not in the same locations). Burney’s study found that at locations that didn’t have a power plant before, adding a natural gas plant led to increases in ozone and fine particulate matter. The gas plants tend to produce about half the particulate matter as coal plants, and around the same amount of ozone. And natural gas is still a fossil fuel, releasing carbon dioxide when it’s burned.

Burney also estimated the impacts of the remaining coal plants that are still running nationwide. Those operating during the same time period contributed to 329,417 deaths and 10.2 billion bushels of lost crops. The big takeaway for her is how these numbers underscore the loss averted with every power plant taken down. “Power generation comes along with a negative set of impacts that we all share, but it’s sort of a nebulous bad thing that we don’t really think about,” says Burney. “Seeing the distribution [of power plants] hit home for me that if a plant shuts down there but not here, those are tangible impacts. There are people that die here but not there.”