If people around the world cleaned up their eating habits, it could potentially prevent one in five deaths globally, according to a new research review published in The Lancet. And the key to eating more healthfully isn’t depriving yourself, the research suggests — it’s adding more healthy foods.

The sweeping review — which analyzed nearly 20 years of dietary data from 195 countries, alongside epidemiological studies about nutrition-related health risks and benefits — estimates that poor diets killed 11 million people around the world in 2017, mostly by contributing to cardiovascular disease and cancer. That makes subpar nutrition a bigger health threat than well-known risks like smoking, according to the research.

“Diet is an equal-opportunity killer. People — independent of age, gender, country of residence and socioeconomic status — to some extent are affected by poor dietary habits,” says study co-author Dr. Ashkan Afshin, an assistant professor of health metrics sciences at the University of Washington’s Institute for Health Metrics and Evaluation. “Low intake of healthy foods and high intake of unhealthy foods is the leading cause of mortality, globally and in many countries.”

Eating too much sodium — which is linked to high blood pressure and heart conditions — was the largest cause of diet-related death globally, the researchers found. But on the whole, “the main problem we see is the low intake of healthy food,” rather than high intake of unhealthy food, Afshin says. Aside from over-eating sodium and trans fats, most of the top dietary risk factors were related to not eating enough nutritious foods, including whole grains, nuts and seeds, fruits, vegetables, polyunsaturated fats and legumes, Afshin says.

That’s an important message, Afshin says, since lots of health advice hinges on cutting out junk food, rather than emphasizing the nourishing foods people should be adding to their plates instead. People may also be more likely to comply with nutrition guidance if they’re told to eat more of something good, rather than less of something bad, Afshin says.

For the study, the researchers focused on 15 food and nutrient categories (like fruits, vegetables, fiber and processed meats) and used existing research to estimate the ideal consumption of that food group, actual consumption for the people in the study and the food’s impact on the risk of developing diet-related diseases and health issues. Using those estimates, they calculated the contribution of each poor food habit to food-related deaths and diseases worldwide. They chose to study health measures directly linked to diet quality — including blood pressure, cholesterol and other metabolic risk factors — instead of obesity and malnutrition.

Poor diets — which include those that are too heavy in sugary drinks, trans fats and processed meats, and too light in whole grains, produce and nuts — were associated with death and disease all over the world. Not a single region ate the optimal amount of all 15 dietary elements, and none of the dietary elements was eaten in the right amount all over the world. The highest rates of diet-related death were found in Oceania, and the lowest were in higher-income Asian Pacific countries, the study says. Out of 195 countries, the United States had the 43rd-highest proportion of diet-related deaths, according to the research.

For people seeking to improve their diets, adding in more whole grains and nuts may be a good place to start, since people in the study weren’t eating nearly as much of them as they should have been, Afshin says. Globally, people were eating only 12% as many nuts they should be, and only 23% as many whole grains, the researchers found. Whole grains have been linked to lower rates of chronic conditions including cancer, Type 2 diabetes and cardiovascular conditions, while nuts are packed with heart-healthy fats and plenty of vitamins and minerals.

“Historically, fruits and vegetables have been the center of attention,” Afshin says. “Although they are important…gaps in the consumption of nuts and seeds and whole grains are much higher.” (That doesn’t mean people should eat more nuts than vegetables, of course — just that more people lag below target consumption of nuts and grains than fruits and vegetables.)

The paper was observational, meaning it can only detect trends and patterns, not causes and effects. Data for some countries was also stronger than others, the researchers say. But despite these limitations, the paper emphasizes that food can be medicine, when eaten thoughtfully — or a killer when it’s not.

Write to Jamie Ducharme at jamie.ducharme@time.com.