Banning trans-fatty acids had a measurable impact on public health in the state of New York, according to a new study recently highlighted by Popular Science. A review of New York State Department of Public Health data from 2002 to 2013, published in the JAMA Cardiology, finds that there were 6.2 percent fewer hospital visits related to heart attacks and strokes in counties that banned foods that contained trans-fatty acids (trans fats) compared to counties that didn’t have a ban in place.

In 2007, New York City, which has five counties, became the first U.S. metro area to ban trans fats in restaurants, bakeries, and other eateries. Six other counties in New York state followed suit over the subsequent five years. Trans fats in foods like Twinkies, Girl Scout Cookies, coffee creamers, and microwave popcorn typically come from partially hydrogenated oils, which have been found to increase the risk of stroke, heart disease, and more. The bans did not apply to packaged food, so people in those 11 counties likely still had some trans fats in their diets, but nonetheless were eating less than their counterparts in the 25 counties in the study without a ban in place.

The study, led by Yale cardiologist Eric Brandt, found that within three years of instituting a ban on trans fats in restaurant foods, counties saw a 6.2 percent total decline in people who went to the hospital for heart attacks and strokes. The data showed that specifically, there was a 7.8 percent decline in heart attacks and 3.6 percent decline in strokes for both men and women.

The FDA began requiring companies to list the amount of trans fats contained in packaged food in 2006, causing many companies to begin reducing or eliminating them from products. After New York City instituted its trans fats ban, California followed suit, as did several individual cities like Philadelphia and Seattle.

It’s impossible to say that the decline in hospital visits was solely due to a reduction in trans fats in diets, but consider how harmful research has shown them to be: Eating just 2 grams of trans fats a day is considered to pose a dangerous risk to your cardiovascular health.

Despite the bans, trans fats still pose a risk to consumers. Any product with less than 0.5 grams per serving can claim to have 0 grams of trans fat, meaning that some foods (like Girl Scout Cookies) can market themselves as trans fat–free but still contain partially hydrogenated oils. That will change soon, though. In 2018, trans fats will no longer be “generally recognized as safe” by the FDA. This will essentially ban the unhealthy oils—since companies would have to prove they are safe to eat before using them.

[h/t Popular Science]