IF YOU WERE like most young guys in college, you had a couple of nights at a friend’s keg party or down at the local bar where you ended up waking up in the morning with little to no idea of how you made it into bed. Or why you were missing a tooth. Or where your pants were.

So yeah: Blacking out and losing memory is a regular occurrence when people drink to excess. But drinking while doing a memory exercise actually led to better recollection in a recent study from the University of Exeter in England.

For the study, scientists gathered 88 men and women accustomed to drinking alcohol—so, yes, a relatively tiny study—and put them into two groups that were both assigned to a word-learning task. One group could drink as much as they wanted, while the other was told not to drink anything. The following day, both groups met up and all did the same word-learning test—but those who imbibed the night before remembered more of what they had absorbed previously.

Though how much alcohol you should drink to get any health benefits has been debated in the last few years, it’s generally thought to be safe—and possibly beneficial—if you keep your consumption at about two drinks per day, saccording to the U.S. Centers for Disease Control. Drinking to excess, though, has been found to contribute to all sorts of nastiness, like increased risk of cancer, heart murmurs, poor sleep, and loss of muscle mass—so keep your beer binges to a minimum. Plus, swearing off booze altogether is a good way to prevent extra calories from sneaking into your diet.