There’s a reason you reach for the ice cream when you're feeling down. How we feel affects how food tastes and what we crave, according to a new study in the journal Appetite. 

Food science researchers from Cornell University surveyed 509 attendees at eight university hockey games across the season. The home team performed variably—in some games Cornell won, in others they lost, and in one, they tied. After each game, the researchers tested how different emotional states prompted by the team’s performance changed how two samples of ice cream tasted. One ice cream was salted caramel pretzel flavor, and the other was a lemon-lime sorbet. 

A follow-up survey determined how much participants perceived the different flavors (sweet, salty, bitter, sour, etc.) and how much they liked the ice cream. When the team won and fans were happy, they tasted sweetness more intensely, but when the team lost, they tasted sourness more intensely. The pleasurable event enhanced sweetness, while the negative experience enhanced sourness. Flavor two, the sour lemon-lime sorbet, was rated more highly after a positive event, and rated less pleasant after a loss.

A less liked food becomes less palatable in times of unhappiness and more palatable in times of happiness,” the researchers observe. “It is possible that the diminished sweet and amplified sour intensities perceived under negative emotions in this study could explain the compensatory increased intake and simultaneous preference for sweet, palatable, and energy-dense foods” seen during emotional eating, they write. So when you’re sad, you reach for ice cream or something else sweet and delicious, because you’re looking for food that won’t be ruined by your change in tastes.

And that’s why no one stress eats kale after a breakup.