Here’s a joke: What’s the quickest way to the hospital? Easy — all you have to do is stand in the middle of the road.

If you think the joke is funny, then you probably understand that part of the humor stems from the fact that it’s true. If this describes you, prepare to have your ego inflated: According to new research, an appreciation for dark humor is also associated with higher intelligence and emotional stability.

In a paper recently published in Cognitive Processing, a team of researchers do exactly the least funny thing possible — explain why jokes work. The specific goal was to determine what it is about a person that makes them enjoy dark, twisted jokes. These are the jokes that deal with death, disease, and deformity. Jokes like: What do you think the country will be like after Trump is president for four years? I don’t know; we’ll all be dead in two.

To figure this out, the researchers tested the verbal and nonverbal intelligence, mood, and level of aggressiveness of 156 study participants. After this assessment, the researchers showed them 12 dark humor cartoons from a collection called “The Black Book by Uli Stein” and asked them to rate the jokes for how much they liked them, how vulgar they seemed, and to what degree they found the jokes difficult to understand.

To their surprise, the researchers found that the people who most enjoyed the dark jokes also rated the highest for verbal and nonverbal intelligence, had higher education levels, ranked low on aggression, and had the chillest moods. The people who enjoyed the jokes the least were people who were very aggressive and had “high mood disturbance.” In other words, they were the sort that would probably get pissed at these jokes, instead of laughing:

The researchers argue that these results are further proof that humor depends on both cognitive and emotional factors and that hearing a joke triggers a complex information-processing task. Jokes work when the listener’s mind permits frame-shifting and conceptual blending; a person has to have a sense of the world in which the joke exists and then they have to be okay with shifting that reality into something more ridiculous. Jokes are essentially a two-stage puzzle, involving a query and then an answer. But if you can’t jump from point A to B quickly enough, you’re not going to get the joke.

So the fact that a smarter person would be better at getting jokes makes sense — they’re equipped with the mental capacity to rapidly cipher through the processing stages and emerge with a lol. What’s more surprising, the researchers write, is that the people who liked dark jokes weren’t necessarily dark people — they were actually more cheerful than the aggressive grumps who said they didn’t get the humor. And the reality of a super dark person not getting a super dark joke is something that we can all laugh about.

Photos via Flickr/K.C. Green