One of the most memorable characters of Saturday Night Live from the 1990s was Mary Katherine Gallagher, the eccentric Catholic schoolgirl known for enjoying the smell of her own sweat. “Sometimes when I get nervous,” she says, “I reach my hands under my arms…and I smell ‘em like that.”

Gallagher’s olfactory habits, though peculiar, may have been vindicated by science recently, as new research has emerged suggesting that people’s disgust for sweaty-smelling objects differs depending on whose sweat they think it is. The research, led by John Drury and published at the journal PNAS, looked closely at how disgusted university students were after smelling a sweaty t-shirt. The researchers wondered if students would be less disgusted if they believed the t-shirt belonged to someone from their own university.

To test this idea, experimenters at the University of St. Andrews obtained some sweaty t-shirts by asking a research assistant wear three different shirts while running and then place each into its own tightly sealed plastic container. One t-shirt was plain white; one had a St. Andrews logo; the third had the logo of Dundee University, a local “rival” university. The researchers then recruited students and randomly assigned them to smell one of the t-shirts under the guise of an experiment on pheromone detection.

To measure students’ disgust, the researchers devised an ingenious strategy that allowed them to avoid the potential biases of self-reporting. Before the start of the experiment, they placed a hand sanitizer dispenser across the room. Then, after subjects had picked up and smelled the t-shirt, they measured the precise amount of time it took them to walk over and collect the hand sanitizer, reasoning that those who rushed over to clean their hands were likely more disgusted than those who took their time. The study revealed that students were fastest to wash their hands after smelling the plain t-shirt, and, as expected, were least disgusted when smelling a t-shirt from their own university. This suggests that people’s disgust is affected by who they think the smell is coming from.

The results for the Dundee t-shirt were even more revealing. In addition to the procedures described above, the researchers attempted to reframe the identity of the subjects. They divided the students into two groups. One group they told they were researching the behavior of students in general. The other they told they were researching the behavior of St Andrews students alone. They then asked the subjects to write down three defining characteristics of students in general or of St Andrews University students.

This manipulation significantly altered the subjects’ reactions to the Dundee University t-shirt. Specifically, those in the “St Andrews” condition were highly disgusted by the Dundee t-shirt, rushing to wash their hands as fast as if they’d smelled the t-shirt from the unidentified stranger. By contrast, those in the “general student” condition demonstrated far less disgust, showing no urgency in washing their hands. The reason has to do with the way humans think about group membership. For students in the “St. Andrews” condition, the Dundee t-shirt represented an out-group, the enemy. Accordingly, they treated it as a disgusting object. On the other hand, when the subjects were thinking of themselves as students, the Dundee t-shirt represented the property of an in-group member—a fellow student. They treated it as one of their own.

These findings have several interesting implications. First of all, it corroborates the notion that people think of their own groups as an extension of the self. Mary Katherine Gallagher prefers the smell of her own sweat; human beings extend the same leniency to people within their own social circle.

Furthermore, it highlights the profound impact of our group memberships on our perception of the world. It is well known that people favor friends, family members, even members of their same community. Such groupish tendencies underlie many of the divisions in the world we see today, from conflicts in the Middle East to racial tensions in the U.S. It is fascinating to see just how deep-rooted these prejudices are, extending not just to explicit attitudes about friends and strangers but also to tendencies as hard-wired and intrinsic as disgust.

Yet, on a more uplifting note, it shows how malleable these group memberships can be. Simply reframing subjects’ identity is sufficient to shift their perceptions of the shirt from stranger to friend. This points the way to important interventions we might enact in situations of inter-group conflict. By recasting people’s identity in terms of their common humanity, as opposed to their idiosyncratic traits, we may be able to foster a feeling of common purpose, one whiff at a time.