We’re all familiar with the idea of treating ourselves when we need a mood boost. But a new study published in Nature Communications suggests we should treat others—or just think about being generous—if we want to feel happier, TIME reports.

Researchers from the University of Zurich in Switzerland told 50 participants they would receive $100 over the course of a few weeks. Half of these people were told to spend the money on themselves while the other half were told to spend it on a friend. Before they received the money, participants were asked to think about who they would spend the money on and how much they’d likely spend. The researchers then scanned regions of participants’ brains associated with “social behavior, generosity, happiness and decision-making” using MRI machines, Amanda MacMillan writes for TIME. While their brains were being scanned, participants also completed a decision-making task where they could “behave more or less generously,” according to the study.

Previous studies have shown that being generous can lead to physical and mental perks, but the goal of this study was to see if simply committing to future generosity could yield similar benefits.

The findings suggest there may be something to that hypothesis. The researchers found that depending on how they’d been directed to spend the money, participants’ brain activity and decisions changed: those who were told to spend the money on someone else were more likely to make generous decisions on the tasks throughout the experiment compared to the “treat yourself” group. 

The generous group also showed more interaction between the brain regions linked to altruism and happiness, MacMillan writes. Plus, generous participants reported being happier once the experiment was over.

Here’s another interesting finding: Pledging to give a small amount of money away had the same happiness-boosting effect as giving away a lot of money, according to MacMillan.

That’s good news to those of us seeking a generosity-induced mood boost on a budget: “It is worth keeping in mind that even little things have a beneficial effect—like bringing coffee to one’s office mates in the morning,” lead author Philippe Tobler, associate professor of neuroeconomics and social neuroscience, told TIME.

It’s important to note that the researchers aren’t sure if these results hold true if your only motivation is to make yourself happier. Meaning just thinking about doing something nice for another person could make you feel good, but it’s in your best interest to actually follow through on that thought .

Read more on TIME