The many health benefits of chocolate have been well-publicized, including that it protects our brains. Now there’s a new reason to love this dark, delicious treat—especially if you’re concerned about your aging memory or don’t get enough sleep!

Background: Recent studies suggest that the flavanols—naturally occurring compounds found in cocoa beans—that are responsible for the cardio benefits of chocolate and cocoa do more than just protect brain neurons. They might also repair cognitive damage caused by certain kinds of stress.

To get a clearer picture, Italian researchers analyzed data from 49 studies on cocoa flavanols to see how they affect the brain in the hours after consumption and over an extended length of time.

Findings: The neuroprotective properties of cocoa flavanols appear to enhance working memory and improve visual information processing when those functions are damaged by stress.

For instance, in one of the studies, healthy young women who ate flavanol-rich dark chocolate (520 mg total flavanols) after a night of no sleep showed less cognitive impairment when performing tasks than those who ate chocolate with a lower flavanol content (88.5 mg)–potentially encouraging news for insomniacs and shift workers!

In another study, elderly individuals who consumed a concentrated, flavanol-rich cocoa drink that contained 520 mg or 993 mg total flavanols daily for eight weeks improved their attention, processing speed, working memory and verbal fluency.

Surprising finding: The beneficial cognitive effects were most pronounced in people  whose memory was starting to decline or who had other mild cognitive impairments. The researchers speculate that this unexpected result for older adults “suggests the potential of cocoa flavanols to protect cognition in vulnerable populations.” They point out that cocoa flavanols can increase cerebral blood volume in the dentate gyrus of the hippocampus, an area of the brain that is particularly affected by aging and potentially a source of age-related memory decline.

Bottom line: Although cocoa “prescriptions” aren’t here yet and the amounts of cocoa flavanols in the studies were higher than what you’d get from even dark chocolate (which might have about 100 mg in 3.5 ounces of 72% dark chocolate), it’s nice to have another reason to go ahead and indulge. The darker the chocolate, the better, and look for cocoa powder that has not been alkalized, or “Dutched,” a process that reduces the flavanol content. Keep your daily dose moderate–bear in mind that chocolate also comes with sugar and calories.

(Psst! Check out another way to protect your memory that’s as much fun as eating chocolate!)