Your parents told you it was wrong to discard food when there were children starving in Africa. It turns out the clean plate club could solve world hunger and climate change. Seriously.

One morning in August, the Rev. Charlie Overton got a phone call. A frantic logistics rep at a Kentucky-based trucking company was looking for help for one of his drivers.

The driver was supposed to be making a pickup nearby, but his trailer was full of cantaloupe — 42,000 pounds of it. The driver had tried to deliver the fruit to a regional grocery chain in Mount Juliet, Tennessee, but the store buyer rejected it. The melons were perfectly ripe and the supermarket feared many would not sell before they began to rot.

Overton is the Tennessee program manager for the Society of St. Andrew, a national religious nonprofit devoted to feeding the hungry with food that would otherwise be wasted. Overton found a distributor that could handle 42,000 pounds of cantaloupe and get it distributed to various local food banks and soup kitchens.

Then the rep called again. A second driver’s melons had been rejected. Overton worked the phones again, finding another distribution site where this driver could unload the melons.

“Where large, regional food banks sometimes have difficulty accepting food quickly for their pantries, we are able to distribute directly to any pantry that can receive them,” Overton said.

And so, within 30 minutes, 84,000 pounds of cantaloupe that almost become 84,000 pounds of landfill, instead became 250,000 servings of nutritious fruit for Tennessee families in need.

What’s unusual about this story is not that two truckloads of perfectly ripe melons were almost left to rot. 

It’s that in this case they made it to some of the 17 million Americans who, by conservative estimates, lack reliable access to food.

Read More: Get the Facts on Food and Nutrition »

In recent months, wasted food has gained more attention as a genuine health and environmental problem. In September, both the U.S. federal government and the United Nations announced plans to cut food waste in half by 2030.

Two looming global issues have brought the problem to the fore.

“It’s a combination of looking out into the future and trying to project how we’re going to feed future populations, which are growing both in numbers and in resources, so there will be demand for more food and for resource-intensive foods like meat,” said Dana Gunders, M.S., a senior scientist at the Natural Resources Defense Council (NRDC). “We also have climate change that we’re staring in the face.”

Food waste is a problem on this global scale.

Gunders helped drive growing awareness about the problem with a 2011 NRDC report. Wasted food began for her, as it does for most environmentalists, as one more item on a list of the environmental impacts of commercial agriculture.

“I started digging into the topic and coming across these numbers. I thought if these numbers were true, we’d all be talking about them. But the more I dug, the more I realized they were true,” she said.

Food veers off into waste in dribs and drabs at every point in the production and delivery process. As prices shift, shipping sometimes costs more than the crop is worth. In developing countries, food often goes bad during transport. In industrialized countries, buyers often reject food for cosmetic reasons and throw it out when it passes its “best by” date. Consumers often buy food that they fail to eat.

With NRDC’s report, “Wasted: How America Is Losing Up to 40 Percent of Its Food from Farm to Fork to Landfill,” a little bit here and a little bit there finally has added up to a massive problem.

A third of all the food produced worldwide is wasted. With the food currently lost, the international community could feed the 811 million undernourished people in the world and still reduce by a quarter the amount of additional food the United Nations predicts we’ll need to feed the coming population surge.

The United States is more wasteful than average. We let between 30 percent (according to the U.S. Department of Agriculture) and 40 percent (according to NRDC) of our food supply rot. Consumers ultimately throw out a quarter of the food they buy, at a cost of $1,500 per year for a family of four.

The environmental cost of the waste is immense. “One reason why food waste is such a big problem is because every piece of food we waste represents so much loss,” said Marcia DeLonge, Ph.D., an agroecologist at the Union of Concerned Scientists.

Industrial agriculture produces a lot of food, and it takes a lot of water, chemicals, land, and fuel to do it.

Nearly all of the 133 billion pounds per year that Americans waste ends up in landfills. When food rots in a landfill, it heats up and produces methane, a greenhouse gas 23 times more powerful than carbon dioxide. Food waste from landfills accounts for almost 25 percent of our domestic methane emissions.

The climate impact of wasted food has put it on the United Nations’ radar. If it were a country, wasted food would rank third after the United States and China in carbon emissions. Producing food that is never eaten guzzles up more water than any single country.

Read More: How California’s Drought Affects Water Quality »

But, for Americans, food is a health issue, and the case for making sure less food gets wasted is a little bit more complicated.

There is some tension between the two causes. Think of it this way: Whenver we decide whether or not to eat food that could be bad, we weigh the risk of illness against possibly unnecessary waste.

“If we’re trying to get people to eat more fruits and vegetables, they need to buy them. But often they’ll go buy them and not eat them,” Gunders said.

Indeed, produce is the most commonly wasted food. Americans eat, on average, just 1/2 of the 3 cups of fruits and vegetables a day that nutritionists recommend.

It may not be obvious in the moment, but wasting food leads to climate change, which also threatens our heath, just not as immediately.

“When we think really big picture, climate change is one of the biggest if not the biggest threat that we have to public health,” said Roni Neff, Ph.D., the director of food systems and sustainable progress at the Johns Hopkins Center for a Livable Future. “Throwing away a lot of food means greenhouse gas emissions that never needed to happen.”

That overlap has spawned interest in tackling the issue holistically by devising ways to improve Americans’ diets that also chip away at food waste.

In the United States, enormous portion sizes at restaurants and the lack of regular fruits and vegetables cooked at home are part of the same broken system where fresh, healthful foods are underappreciated despite their abundance.

“There are a lot of the same root causes when you look at the waste of food and poor nutrition,” Neff said. “There is a profit in getting us to buy more than we really need, and some of it we’ll eat and some of it we’ll throw away.”

DeLonge pointed to a few common causes.

“There’s a problem with distribution; there’s a problem with what we’re growing. We have to look to improving the system,” she said.

Read More: Why Nutrition Advice Is so Confusing »

Food pantries and soup kitchens have to balance nutrition with supply every day. Although their primary mission is to provide food for those who need it, they’ve also come to fill a role as a socially responsible waste management alternative for large food companies, Gunders said. It’s more convenient and economical for companies to donate what they can’t sell than to arrange its disposal.

But food pantries often find themselves between a rock and a hard place. The organizations are sometimes offered large donations of nonnutritious foods, including soda.

Processed foods are not as perishable as produce, so they are more likely to be donated.

It’s not always easy for food banks to turn unhealthful donations away. Consider that Feeding America, which is by far the largest network of food banks in the nation, counts among its major donors General Mills, Kellogg, Kraft, and Nestle. These companies account for nearly every processed food for sale in the United States. How can food banks bite the hands that feed them?

“The food recovery industry feels quite disempowered to really drive for the healthy foods they believe are appropriate,” Gunders said. She thinks limiting tax credits to donations of foods that meet some basic nutritional standards might help reduce the pressure.

The Capital Food Bank in Washington, D.C., which is part of the Feeding America network, has made it a policy not to accept donations of nonnutritious foods. Other organizations have begun to look more aggressively for ways to buy, store, and prepare fresher foods, according to Neff.

And then there are groups like the Society of St. Andrew, which rescue healthful foods from becoming landfill by redirecting them to the people who need them most. They often include recipes with donations to give food banks and soup kitchens  practical ideas for how to use the bounty.

Read More: 11 Billion People by 2100 Could Greatly Impact Global Health »

There’s a movement afoot to do something else with some of the United States’ wasted produce: the ugly part.

Supermarkets like the one in Mount Juliet, Tennessee reject as much as half of the produce that’s grown. This drives farmers to produce substantially more than they expect to sell. Much of the produce that doesn’t meet buyer specifications is simply plowed over at the farm before it has a chance to reach a pantry or the landfill.

Retailers insist that consumers simply won’t buy produce that is blemished, misshapen, or otherwise unsightly. But there may be a way to make these ugly ducklings look like swans to consumers.

“A lot of business waste is happening because of perceptions of what consumers will accept,” Neff said. “I think that we’ll find that consumers are plenty happy to buy these products if they’re sold at a discount.”

Jordan Figueiredo, a waste management consultant, has become an activist on behalf of this “ugly” produce. He organized a Feeding the 5000 event last year in Oakland, California, where produce that supermarkets wouldn’t touch fed 5,000 people.

On social media, Figueiredo humanizes misshapen vegetables: There’s a fist-shaped carrot and another that looks like a couple dancing. A sliced tomato has an old man’s face.

If the response he’s gotten is any indication, he says, Americans are more than willing to embrace “ugly” produce, especially if they get a deal.

Figueiredo has lobbied major grocers to set up produce “seconds” bins, citing surveys that suggest that price drives many Americans away from fresh foods. Stores in France and the United Kingdom have offered such discount produce with great initial success.

“Unless big supermarkets start buying this, nothing is really going to happen,” he said.

Read More: Nutritious Food Out of Reach for 20 Percent of U.S. Households with Children »

In our kitchens, the most common reason Americans jettison food is fear that it has already gone bad. The milk says “best by November 23.” A can of beans is emblazoned with a date in 2014. Are they OK?

Chances are, both are perfectly edible and safe. Yet a quarter of U.S. consumers always throw food out immediately after the date indicated on the packaging. Nine in 10 sometimes do.

But the dates on food packaging aren’t scientific; they really only represent the manufacturer’s best guess of when the products will lose optimal freshness.

“There’s this mass misinterpretation about that,” Gunders said.

The dates are guided by a mishmash of state regulations and they bring with them a range of wording that may mean specific things that consumers rarely understand.

The NRDC would like to see standardized words and meanings for these labels. Studies have shown that consumer waste patterns changes when labels do.

The NRDC would also like the United States Department of Agriculture to do an assessment of its food grading system — the one that brings you descriptions like “grade A extra fancy” — to see if it may needlessly cause some foods to be trashed.

Ultimately, it may take large scale shifts in the way we produce, distribute, and sell food to shave big margins off food waste. The USDA led the charge to produce more starting in the 1970s, and international efforts to reduce waste may require the agency to lead a new charge: aiming for just enough.

“We have to remind ourselves of the great progress that we made in the agricultural system and appreciate the progress that’s come out of a great deal of investment,” DeLonge said. But “the fact is we still have people going hungry and we still have a depressing rate of diet-related diseases. When you look at food waste problems that we have, it’s a reminder that the story isn’t that simple.”