The remedy to bean-related bloat is likely already in your spice cabinet.

Whether we’re talking black beans, red beans, kidney beans, etc., beans—which are a staple of cuisines and vegetarian dishes around the world—are a great source of fiber and protein. However, beyond being a foundation for many a nutritious meal, they also get a bad rap for leaving diners gassy, with bloated stomachs.

According to Healthline, beans have high amounts of complex sugars present and when the large intestine digests them, they produce carbon dioxide and hydrogen. These gases pass through the body and cause flatulence.

While there are over-the-counter enzymes that digest the sugars in beans, such as Beano, there are also ingredients right in your spice cabinet that can aid with digestion and help offset gassy side effects. One of them that happens to go especially well with beans: cumin.

Cumin is made from the dried “seeds,” or small dried fruits, of Cuminum cyminum, a plant in the parsley family. It is also a signature flavor in Middle Eastern and Mexican cuisines, and is commonly found in Texan and Southwest American fare. Also a key component to Indian curries and chutneys, cumin is one of the most widely popular spices across the globe. The spice imparts a nutty, earthy and warming taste, enhancing vegetables and marinades.

According to Matther Thorpe MD, PhD, cumin has long been used in traditional medicine, with the most common use for indigestion. According to Thorpe’s research reflected in an article for Healthline, you can gain some of the medicinal benefits of cumin by using small amounts to season food.

Adding cumin to your pot of simmering black beans is easy enough. Cumin can be purchased as whole seeds or ground, with the ground powder being a more popular choice for easily and quickly imparting flavor throughout a dish. For a pot of pre-soaked or canned black beans, ground cumin matched with minced garlic and fresh cilantro is a combination that not only tastes great, but will aid you long after you’ve finished your meal. Love using black beans for vegetarian tacos? Be sure to add cumin to your seasoning. A mix of cumin, chili powder, and garlic powder makes for an excellent, and versatile DIY taco seasoning.

Moral of the story: Adding cumin to your next batch of beans is an all-around win-win, providing a boost of flavor and a helping you bypass the gas later.