I recently traveled to Switzerland to take a giant whiff of pit latrine odor. What I inhaled was a strong kick to the nostrils, a potent combination of sewage stink, barnyard sweat, and bitter ammonia topped off with vomit (or was it parmesan cheese?). The stench was foul and made me wince.

Fortunately, I also got to smell something much fresher and more pleasing during my trip. I took the first sniffs of a future of odor-free toilets and better sanitation for all.

These olfactory revelations occurred during my tour of Firmenich, a family-owned fragrance and flavor company based in Geneva. The 120-year-old firm is known for crafting some of the world’s best-known fragrances and enhancing the flavors of beverages and foods. But it is also one of our foundation’s newest partners in the effort to improve sanitation in the world’s poorest countries.

I’ve written before about the world’s sanitation challenge. The numbers are staggering. One billion people have no access to toilets so they defecate out in the open. Three billion more have toilets, but their waste is dumped untreated, seeping into water and food supplies. About 800,000 children under age 5 die each year from diarrhea, pneumonia, and other common infections caused by unsafe water and sanitation. Beyond the tremendous human suffering, it’s a problem that slows economic development. In India alone, poor sanitation costs nearly $55 billion each year—more than 6 percent of GDP.

So how could a perfume company help?

Because smell matters.

Millions of new toilets are being built around the world to help end open defecation, including in India where a massive new toilet construction program is currently underway. This is great news. Unfortunately, many of these new toilets, especially the pit latrines, don’t get used because they smell bad and people continue to relieve themselves in the open where the air is fresher. This is a worrying trend that threatens to undermine the progress that’s been achieved in global sanitation.

A few years ago our foundation organized a “smell summit” to discuss ways to address this problem. Representatives from Firmenich were among the attendees and they thought they might be able to help.

With more than a century of experience creating perfumes and flavors, Firmenich has developed sophisticated approaches to analyzing odors and breaking them down to their chemical components. They started their work with the foundation’s sanitation team by asking a basic question: why do toilets smell so bad?

The answer may seem obvious. But toilet odors are actually quite complex. They consist of more than 200 different chemical compounds arising from feces and urine that change over time and vary depending on the health and diet. Firmenich researchers wanted to know which ones were responsible for the terrible smell.

They isolated four chemical culprits: indole, p-cresol, dimethyl trisulfide, and butyric acid. Then, they asked their scientists to try to recreate the odor using synthetic compounds. In other words, they made a fragrance that smelled like fecal matter and stale urine. A poop perfume!

To make sure they got the offensive odor just right, Firmenich asked people in Switzerland, India, and Africa which fragrances most closely mimicked a stinky toilet. The result of their efforts? The fragrance I breathed in during my visit. I put my nose up to a glass sniffing tube in Firmenich’s research facility and I was hit by a blast of foul-smelling odors. As I described (perhaps too vividly) above, it smelled as bad as the worst toilets I’ve ever visited.

With the poop perfume in hand, Firmenich’s researchers could use it to experiment with various other fragrances, exploring how to effectively mask the offensive odors.

In the long history of battling disagreeable odors, from sweaty armpits to wet dogs, the world has largely relied on one solution to the problem. We use pleasant fragrances to cover over the malodors we want to hide—the olfactory equivalent of sweeping dirt under a rug.

Firmenich wanted to try a different, more innovative approach to this age-old challenge. They wanted to attack the problem on a molecular level at the connection between our noses and our brains.

Our noses have 350 olfactory receptors, each one awakening us to new sensations from the smell of a rose to stinky feet. Just a handful of them allow us to smell repulsive odors. Firmenich researchers used this knowledge to develop fragrances that block certain receptors in our noses, making us unable to register certain malodors.

The approach is similar to noise-canceling headphones which many people use to block out jet engine noise on flights. Electronics in the headsets create a sound wave that is 180 degrees out of phase with the ambient noise that needs to be blocked. This wave cancels unpleasant sounds and allows you to enjoy peace and quiet. Likewise, the ingredients in the fragrances developed by Firmenich inhibit the activation of the olfactory receptors sensitive to malodors. By blocking the receptors, our brains do not perceive the bad smells.

I had an opportunity to experience the odor-blocking fragrances in action. I was invited to push my nose into a glass sniffing tube and breathe in a mixture of the poop perfume I had just experienced and one of the new odor-blocking fragrances. It smelled pretty good. There was no evidence of repulsive odor I had experienced earlier. Instead of stinky sewage, sweat, and ripe cheese, I sniffed a pleasant floral scent.

The question now is whether this technology is good enough to make a difference in communities with poor sanitation. That’s why Firmenich is launching pilot projects in communities across India and Africa to understand whether the fragrances will make toilets and pit latrines more inviting for users. They also need to determine if it’s better to distribute the fragrance as a spray, a powder, or something else. The ultimate goal is to make the product affordable and easy-to-use.

I continue to be amazed by the innovation that’s underway in the field of sanitation. Until recently, sanitation was a taboo subject. It didn’t attract many resources or interest from researchers. Now, dozens of researchers, technologists, and decision-makers from both the private and public sectors are partners in the effort. Together, we are working to identify and develop solutions that people value and that will improve the health and dignity of urban slums and other densely populated communities where the need for better sanitation is greatest.

I was excited to see Firmenich contributing its expertise and creativity to solving this challenge and look forward to updates on the progress they’re making.

It had been a busy day in Geneva for my nose and my 350 olfactory receptors. But one scent continues to linger. It’s the smell of success—the kind that happens when people put their talents together to make the world a better place.