Ikea’s furniture—omnipresent, affordable, and user-friendly—is so popular it can be found in apartments, for sale on Craigslist, or curbside, following years of loving use. The Swedish mega-retailer sells approximately $44.6 billion worth of its 12,000 products a year, and roughly one of every 10 of those items is returned—15% of which become waste. Given this high turnover rate, Ikea has recently announced a new approach to handling returned merchandise without relegating it to the trash bin: artificial intelligence.

It’s part of Ikea’s larger push to reduce its carbon footprint. Jesper Brodin, CEO of Ingka Group (the company that oversees Ikea’s retail outposts), has expressed a commitment to making the company “climate positive” by the end of the decade; the company has allocated roughly $223 million to the initiative and has pledged to invent more energy-efficient alternatives for some of its most popular products.

Waste poses a particularly tricky problem. Once a product leaves an Ikea store, the company doesn’t have much control over whether it gets returned, passed on to some college kids, or ends up in a landfill. So Ikea is trying to prevent waste in the first place. The company installed an AI platform developed by the logistics software company Optoro Inc. (of which Ikea is an investor) in 50 U.S. locations last fall, the Wall Street Journal reported. So far it only covers items returned from in-store purchases, but the software is expected to accommodate online returns soon, too. It works by predicting the best possible destination for returned merchandise, whether that be back on the floor, up on the website, donated to charity, or sold to a third-party wholesaler. The algorithm determines this based on what makes most sense for Ikea’s profits.

The software depends little on human Ikea employees, except for in the early stages of processing. Sales associates are expected to enter identifying information about the returned item (likely a SKU number) along with its condition when it’s returned. This tells the Optoro system (which uses previous transactions and other data) what it needs to determine the product’s fate.

“By working with Optoro, we are using the system to help us minimize any waste from our products or our return flow,” Selwyn Crittendon, IKEA’s business development manager for the U.S., told WSJ. “That will help us [achieve] 100% circularity and zero waste.” The AI system also provides a road map for all the places where product parts can end up before they go to waste.