Researchers have been working for years to develop methods to turn food waste into a viable and economic energy source. Americans waste up to 40% of the food produced each year for domestic consumption and capturing the energy from that waste could help power the electric grid of the future.

Now, researchers at Cornell University have found a new way to capture nearly all of the energy in a food waste product, leaving little behind to fill a landfill. First, the researchers applied a method to “pressure cook” the waste, creating a crude liquid that be turned into a biofuel. Then, what remains is broken down into methane that can be burned to create electricity and heat.

“Food waste should have a high value,” says study author Roy Posmanik, a Cornell postdoctoral researcher, in a statement. “We’re treating it as a resource, and we’re making marketable products out of it.”

The development comes as scientists continue to explore what role waste can play in a clean energy future. Researchers have begun using biofuels, essentially a fuel source that comes from living matter, for a variety of different purposes from ethanol in gasoline to agricultural waste in jet fuel. It could also be used as an electricity source. The method of using waste to capture natural gas is more established, though researchers say combining the two processes speeds up methane collection.

An effective method of turning food waste to energy carries benefits for humans and the planet beyond creating a new energy source. If humans do not capture methane, the heat-trapping gas enters the air and contributes to climate change. Food waste drives 18% of the methane emissions from landfills, according to an Environmental Protection Agency (EPA) report.

Research on the best way to capture from food waste—and the economic viability of such a task—remains in early stages. But scientists broadly agree that tackling the problem will be a key step in slowing climate change.

Get The Brief. Sign up to receive the top stories you need to know right now. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Justin Worland at justin.worland@time.com.