The study, published in the journal Archives of Sexual Behavior, was inspired by previous experimental research that showed sexual activity enhances episodic memory in nonhuman animals. To test the theory on people, more than 6,000 folks aged 50 and older completed memory tests as well as questionnaires about their health and how frequently they engage in sex and emotional intimacy. Two years later, the same participants were asked to do another memory test.

Those who reported more frequent sexual activity and greater emotional closeness during sex performed better on the memory tests.

Generally, memory worsened for all participants throughout the two years; however, those who reported more frequent sexual activity and greater emotional closeness during sex—especially the older participants—performed better on the memory tests. Despite more sessions between the sheets was shown to boost short-term memory, the study findings did not have much of an effect in the long run, according to Business Insider.

Of course, there are a few study caveats to mention: The results are based on participants’ self-reported data, but humans are known for being subjective about themselves. Additionally, they were only required to report on how often they had sex and intimacy at the beginning of the study, though that activity likely changed over the course of two years.