Welcome to the gastroenterology community! The pains you are having could be related to the gas and bloating you have been having. There are many dietary things that can cause gas such as lactose, beans, onions, etc. However if the pains are that severe and they are becoming more frequent, I would highly recommend seeing a doctor about this.