I learned this rhyme when I was little and it stuck, "Beans, beans, the tropical fruit. The more you eat, the more you poot!" It's true that the foods you eat can lead to organic stomach gases but it can also be associated with a disease like gallstones or some problem with the gallbladder. Then too, it could be that you're swallowing air during the day and the gas could be functional with no disease present at all.
To cure functional flatulence simply change your eating habits and be aware of swallowing air during the day. Belching does not help this problem, it causes you to swallow even more air. If you cut down on cellulose and starchy foods like potatoes, wheat, peas, and onions you will cut out a lot of your gas problem. After eating, sip on a glass of hot water to which you've added a pinch of bicarbonate of soda and 1 drop of peppermint essential oil. This helps not only your stomach, but also the intestinal tract.
If your gas is giving you pain, make a massage oil blend of 1 teaspoon of carrier oil (sweet almond oil, jojoba oil, or shea oil) plus 2 drops cardamom essential oil and 3 drops of peppermint essential oil. Rub this mixture over your whole abdomen in a clockwise direction. Relief is on the way!