According to a new study conducted by the University of Texas at Austin, and published in the journal Archives of Sexual Behavior, women and men both have regret when it comes to sex, but the type of regret differs according to gender.

Both sexes regretted having sex with someone who was not physically attractive. Twenty four percent of women regretted losing their virginity to the wrong person, while 27 percent of men regretted forgoing the chance of having a prospective sexual partner. Other regrets for women included cheating on a past partner and moving too fast sexually. Men, on the other hand, regretted not being more sexually adventurous when they were younger or single. In comparison, gay men, lesbian women, bisexual men, and bisexual women had a similar pattern.

“For men throughout evolutionary history, every missed opportunity to have sex with a new partner is potentially a missed reproduc[tion] opportunity — a costly loss from an evolutionary perspective,” Martie Haselton, a UCLA social psychology professor said in a statement.

The study was broken up into three experiments. For the first one, 200 participants evaluated hypothetical scenarios in which someone regretted pursuing, or were not able to pursue, an opportunity to have sex. They were then asked to rate their regret on a five-point scale. The second experiment asked 395 participants to write a list of common sexual regrets, and asked them to identify which ones they had experienced personally. The final experiment mirrored the second one, but on a larger scale, and produced the same results — it included 24,230 individuals who were heterosexual, homosexual, or bisexual.

“For women, reproduction requires much more investment in each offspring, including nine months of pregnancy, and potentially two additional years of breastfeeding,” Haselton said in the statement. “The consequences of casual sex were so much higher for women than for men, and this is likely to have shaped emotional reactions to sexual liaisons even today.”

This might also be a reason why studies have found a link between casual sex and depression, especially at a young age. Casual sexual relationships may hurt the ability of young adults to develop committed relationships at an important time in their development, Claire Kamp Dush, assistant professor of human sciences at Ohio State, said in a press release for the study. This might hinder a person’s opportunity to thoroughly understand the implications behind sex in order to correctly choose the correct partner — from an evolutionary standpoint.

This all might seem antiquated and we may have come a long way since our hunter-gatherer days, but the mindset of these regrets seems to have ties to ancestral links. “We have reliable methods of contraception. But that doesn't seem to have erased the sex differences in women's and men’s responses, which might have a deep evolutionary history,” said Haselton.