When you’re able to exercise bladder control — or, let’s be frank, hold in your pee — you wouldn’t think to thank your brain. And yet, it’s your brain that makes it so your pelvic muscles contract in the first place.

Or at least that’s what researchers from the University of Southern California discovered when initially setting out to study the source of chronic abdominal and pelvic floor pain. “We knew that pelvic floor muscles contract involuntarily in healthy people to make sure they don’t accidently urinate, but we didn’t know what part of the nervous system was doing this,” Jason Kutch, corresponding study author and an assistant professor in the Division of Biokinesiology & Physical Therapy at the USC Ostrow School of Dentistry, said in a press release. “Now we know that there are specific brain regions controlling involuntary pelvic floor contraction.”

Kutch, in addition to researchers from USC and the Loma Linda University Medical Center in Loma Linda, Calif., established this connection when using electromyographic recordings (EMG) to extend and demonstrate existing research that showed pelvic floor muscles work in tandem with a variety of other muscles. Think of when you squeeze your glute muscles to hold in your pee; these would be the two different muscle groups that work together. As defined by John Hopkins Medicine, an EMG simply means a way to “measure muscle response or electrical activity in response to a nerve’s stimulation of the muscle.”

Then, with the help a functional MRI, researchers took it a step further to pinpoint the specific part of the brain that activates these muscles at the same time. It’s known as the medial wall of the precentral gyrus, or the part of the primary motor cortex which helps with planning and executing certain movements. “We hope that this vein of research will help us to find the causes of chronic pelvic floor pain, which disproportionately affect women, and may even yield information that could help people struggling with incontinence,” Kutch said.

Bladder control is a mild way of putting urinary incontinence. According to the National Institute of Aging as part of the National Institutes of Health, long-term bladder problems “may be due to weak bladder muscles, overactive bladder muscles, damage to nerves that control the bladder, blockage from an enlarged prostate, and diseases such as arthritis.” It’s not something that can be diagnosed, and properly treated, without seeing a doctor. It’s also not something that has to be permanent. Pelvic muscle exercises, like kegels, urinating on a set schedule, and lifestyle changes, like losing weight and cutting back on caffeine, are all solutions to consider.

Source: Asavasopon S, Rana M, Kirages D, Yani M, Fisher B, et al. Cortical Activation Associated with Muscle Synergies of the Human Male Pelvic Floor. Journal of Neuroscience. 2014.