You’ve heard that chimpanzees can learn sign language. But here's something you didn’t know: chimps use what they learn to create sign language swear words.

That’s according to Emma Byrne, author of Swearing Is Good for You: The Amazing Science of Bad Language (out Jan. 2018).

Byrne explains that once chimps learn the hand signs for “dirty”—a gesture they’re taught when they go to the bathroom, and so associate with feces—they start to use the same sign in other contexts when something is bad.

For example, if the chimps’ keeper takes away their food, “rather than throwing their crap around when they're angry and frustrated”—which is normal chimp behavior—“they use the sign for it instead,” Byrne says.

Why do they do this? According to Byrne's research, swearing helps both chimps and humans alike blow off steam and let out emotion. And even though it might get you in trouble with your supervisor at work, swearing also has a number of both physical and mental health benefits. Here are just a few.

8 Weird Facts You Never Knew About Your Heart:

preview for 8 Weird Facts You Never Knew About Your Heart

1) Swearing can help us control our tempers.

Byrne says our human ancestors probably developed swear words as a way to express their anger without resorting to physical violence. In fact, swear words might have been some of the first words early humans created. “If someone swears at me for failing to do my part to catch that tasty antelope, I can get right back out there and hunt,” she says. “But if they've broken my arm, then I'm quite literally dead weight.”

2) Swearing makes you impervious to pain.

Well, sorta: while a dirty mouth won't make you a superhero, research shows that swearing can increase your tolerance for both physical and emotional pain. Pissed off at work? Swearing will likely make you feel better, Byrne says.

“We know that people with terminal or chronic illness use swearing as a way of dealing with fear and frustration,” she adds. “It's a lot less debilitating than curling up in a little ball and crying.”

3) Swear words literally activate your brain.

Swearing is so important to us as a species that it activates parts of our brain that no other words engage, Byrne says. In fact, Byrne has previously claimed that swearing can help stroke victims re-learn their capacity for language.

“If you suffer a stroke on the left side of your brain, there's a good chance it will damage your language facilities,” she says. But because swear words engage both the emotion-oriented and language-oriented parts of your brain, “there are lots of brain-injured patients who can express themselves pretty fluently, but purely through swearing,” Byrne says.

These patients can’t access the words for “I’m angry,” or “I’m so happy.” But they can still express these emotions with the appropriate swear words, she says.

4) Swearing takes smarts

While the claim that swearing is a sign of intelligence has gone viral in the past, it's only partially true: any moron can litter his sentences with F-bombs. It’s more accurate to say that swearing appropriately and with a variety of curse words—a well-timed “shit-kicker” for comic effect, or a “fuck” to emphasize a point—requires tact and brain power.

“For all of its shock value, swearing is surprisingly subtle,” Byrne says. She describes the timely deployment of curse words as intelligent, powerful, and, in some cases, “socially essential.”

But just like your IQ remains fixed and unchanging over time, your capacity to swear is fairly static: you can’t really teach someone how to swear better. If you’re unsure about when it's appropriate to let an F-bomb fly, keep in mind that it’s safer at work or in other formal contexts to avoid swearing.

But it’s inaccurate to say that only stupid people with bad vocabularies swear. Byrne says that, often, just the opposite is true: in fact, 2016 research from Marist College determined that people who swore often were more likely to have expansive vocabularies than people who didn't.