Women may find themselves occasionally complimenting a guy for the way he smells and may even be subconsciously drawn to him for his scent. A man’s scent plays a significant role in whether or not a woman is attracted to him, according to AskMen. Subconsciously, women will sniff out their “perfect match” to find a partner that can provide a genetic advantage to their offspring, according to David M. Davis, author of the book The Compatibility Gene.

Davis’s The Compatibility Gene is based on the popular and controversial research from zoologist Claus Wedekind’s “smelly T-shirt” experiment. The Swiss zoologist analyzed the DNA of a cohort of students by focusing on histocompatibility genes. The participants of the study included 49 females and 44 males who were split into two groups – males and females.

The researchers asked the men to wear plain cotton T-shirts for two nights while avoiding alcohol, cologne, or substances that can potentially alter their natural odor. After two days of wear, the white T-shirts were placed in cardboard boxes with holes in them. The 49 women were asked by the researchers to rank the boxes based on smell by using three criteria: intensity, pleasantness, and sexiness, The Guardian reports.

Wedekind's findings revealed that women preferred the T-shirts worn by men with different compatibility genes from themselves. Wedekind and researchers suggest that women instinctively choose partners who would provide a genetic advantage to their offspring, since they opt for partners with a different variety of compatibility genes than their own.

Histocompatibility genes help to fight infection and boost the function of your overall immune system, said Steven Marsh, professor and deputy director of research at the Anthony Nolan Histocompatibility Laboratories, to The Guardian. These genes are the molecules that give someone their tissue type and are responsible for accepting or rejecting transplanted organs.

"Recent research shows that they may be even more important than we once thought – there is evidence that they can influence how our brains are wired, how attractive we are, even how likely we are to reproduce,” said Davis.

When a woman smells someone she is attracted to, chances are that person has human leukocyte antigens molecules that she doesn’t have. The difference in these molecules makes the person an ideal mate with whom to have offspring because the woman’s genes and the man’s genes combined create an optimal genetic code, according to Davis’s book.

Davis admits that while mice have detected compatibility genes by smell, and stickleback fish choose their mates by smell, more research has to be done on this function in humans. "How it works on the olfactory level is basically not understood at all," he said.