The other weekend, I found myself at a beach on the outskirts of New York City during sunset. The sky was spectacular, filled with the neon pinks, oranges, and purples that come after a day of rain. As if on cue, the two friends I was with fished their smartphones from their pockets and snapped a photo. My phone was already out. All around us, people were holding their screens up to the sky to document the moment, as if capturing it on camera would somehow make the colors more vivid.

As the sun went down, I felt a familiar pang of guilt. It was the same sense of uneasiness I feel after falling down an Instagram rabbit hole or scrolling through Twitter when I first wake up in the morning—the feeling that maybe I just spent my time unwisely. I could have been down on the sand with my feet in the surf or drinking a beer with my friends or doing any number of cliched things a person does during a sunset on the beach, but I was up on the boardwalk looking through my viewfinder.

Maybe it’s because cameras are with us all the time now, or maybe it’s because social media ruins everything, but somewhere along the way we’ve been conditioned to believe that taking photos is the opposite of living in the moment. That snapping a pic is like pulling blinders over your eyes and opting out of the experience. Despite my momentary anxiety, I don’t actually believe that’s true. And neither does science. Taking pictures, it turns out, can have all sorts of benefits, so long as you’re taking them for the right reasons.

In the last few years, psychologists have started looking into how our ever-present smartphone cameras impact the way we recall experiences. The general assumption is that smartphones—and by proxy their cameras— are bad for our memory and our happiness. But that isn’t always the case. “People feel very strongly that when they take photos it’s taking them out of the moment,” says Alixandra Barasch, a researcher at NYU who studies the effects of taking photos. “Yet after years of running studies, we kept on finding over and over again that there were all of these positive aspects of photo-taking, as well.”

Snapping photos, Barasch and her colleagues explain in a series of recent papers, can both enhance enjoyment and improve memory of certain experiences (it can also reduce auditory recall). The simplest explanation is that when people take photos of things they’re interested in, they tend to focus on those things more intently. This kind of directed attention can lead people to deeper engagement with their surrounding and ultimately create more sustaining memories. “When you’re searching the visual field and trying to decide what to photograph, that volitional process of trying to capture a moment actually draws you into experiences,” Barasch says.

Volitional is the key word here. A few years back, another researcher, Linda Henkel, came to the opposite conclusion. The psychologist at Fairfield University found that taking photos was like exporting your memory to an external hard drive. “As soon as you click on the camera, it’s as if you outsource your memory and said to you brain you don't have to process any more information,” she said to NPR at the time. Though Henkel and Barasch’s experiments seem to contradict each other, they’re actually looking at completely different aspects of photography. While Henkel told her subjects what to photograph, Barasch and her colleagues let people decide what to document. That voluntary decision-making process what accounts for the major difference in findings. “It doesn’t surprise me when people take picture of things they want to take pictures of, it might have a different effect,” Henkel says.