You are doubtless aware that sex can improve your mood but did you know that it can also sharpen your memory?

A recent study, published in the journal Archives of Sexual Behavior, showed that people over 50 could boost their short-term memory by engaging in an active sex life. In 2012, 6,016 men and women completed a memory test and questionnaires regarding their health, diet, sex lives, as well as their emotional connection to their partners. In 2014, the process was repeated, and researchers from the University of Wollongong in Australia compared the results to see what changed during that time, as Men’s Health reported.

The bad news is that in general people’s memories declined over the two-year period — but people who had more sex, and felt a stronger emotional bond with their partners during intercourse, scored higher on memory tests, as Men’s Health cited. Sadly, it only boosted short-term memory, not the long-term kind, although there is evidence to suggest that exercise can help out with that.

A 2016 study conducted by a team from Canada’s McGill University also found that women who have more sex have better memories, noted the Independent. They found a correlation between the growth of the hippocampus, the area of the brain the controls emotions, memory and the nervous system, and sex.

Cue the Marvin Gaye.