On my recent reporting trip to Brazil, I went on a hike and got bitten 40 times by an unknown insect.

The welts were larger than mosquito bites and were completely painless until they began itching relentlessly a day later. Worse than the physical irritation, though, was the fact that, as a health writer, I know about all the different diseases South American bugs can carry.

At the time, Zika was just starting emerge, but I was most worried about a different threat: Leishmaniasis. There are several strains of this parasitic infection, but the one in Brazil can damage the mucous membranes in the face, eventually causing the nose and mouth to partly disintegrate.

I know this because I sat in a Starbucks for hours on my last day in Rio, googling every study on leishmaniasis and saving it to Evernote, so that the team of international health experts who would eventually convene in a top-secret clean room and race to find the antidote could use them for reference.

Never mind that I don’t really have that kind of sway with the WHO. Or that it’s unlikely that I have leishmaniasis: It’s rare to see it in Rio, and only a few dozen foreigners get it every year.

Still, the transcript of my thoughts was: What if I have it? What I if I have it? How do you say, ‘Are phlebotomine sandflies prevalent in this area’ in Portuguese?

I was already starting to feel my cartilage go wobbly.

I Skyped my boyfriend. “You’re required to still love me after my nose falls off,” I told him. “Like that lady from The Knick.”

It’s around this time that I could have used an app called Songify. The app turns words that are spoken into a smart phone into a song, auto-tuned and set to music. And now, some mental-health specialists are using the tool to help people overcome obsessive, anxious thoughts like the one I was having. With its help, I could have made something like this:

The underlying principle is that singing your thoughts separates you from their meaning. Almost all people (something like 80 to 90 percent of the population), experience intrusive thoughts—weird little niggling things they don’t particularly want scrolling through their heads. But for people who have obsessive compulsive disorder or generalized anxiety, the intrusive thoughts can become frequent and crippling. With OCD, the thoughts tend to be bizarre, such as thinking that the air will contaminate you. With generalized anxiety, they might be more mundane, like the idea that you’ll be fired if you bungle a work presentation.

Our minds can be Debbie Downers because, evolutionarily, we are predisposed to dwell on the negative and let the positive drift into the background. Simply trying not to think intrusive thoughts doesn’t work. Focusing on something, even in a negative way, wires it even more firmly into our brains.

“There is no delete button in the nervous system,” said Steven Hayes, a psychology professor at the University of Nevada who has used Songify and other techniques in his practice. By telling yourself not to think about something, he says, “you’re increasing the number of associates that remind you of it.”

Instead, it’s better to treat them just like you would a silly, meaningless song. They exist, but they have little bearing on your life.

Songify was only released four years ago, and it’s even newer to the therapists who use it. But the process behind the Songify technique, called cognitive defusion, has been around for decades. Before the app came along, therapists would have their patients sing their worries to common melodies. Sally Winston, the co-director of the Anxiety and Stress Disorders Institute of Maryland, once treated a mother who would obsessively text her son to check on him. Winston had her sing, “Johnny is dead by the side of the road” to the tune of “Twinkle, Twinkle, Little Star.”

Similar methods, like repeating an unwanted thought out loud until it loses meaning, or sticking Post-It notes with the thought all over the house, have also shown some success.

Thirty years ago, Hayes saw an older patient who was a devout Catholic. During mass, she couldn’t stop imagining the priest with penises growing out of his ears.

“As you try not to think that, you have to remind yourself of it to see if it’s gone away,” Hayes said. “And there it is again.”

Hayes treated the woman by having her think the penis thought over and over again. First, the thought became less distressing. Eventually, it became less real, too.

Songify was designed for entertainment rather than clinical settings. A Songify spokesperson said the company knew the app had been used to treat speech disorders in autistic children, but was not familiar with its use in anxiety disorders.

Winston said the song technique works better than stress-management, distraction, or breathing exercises. A study out this month found that various defusion techniques, including singing the unwanted thought and saying it in a cartoon voice, reduced the frequency of the thought while making it less believable. The strategy worked better than both the control and another strategy called “restructuring,” in which the person tries to come up with an alternative thought.  

Mark Sisti, the director of Suffolk Cognitive-Behavioral, has been using Songify for two or three years now. He said it tends to work best with people who realize their fears are slightly irrational, or at least are being over-thought. (Someone who just lost his job and is facing very real worries about making rent, for example, might not be the best candidate.) In addition to making the thought less foreboding, Sisti thinks Songify might work by “lighting up” different parts of the brain—the regions associated with music and pleasure, rather than fighting or fleeing.

Hayes has also used singing for other mental-health issues, such as depression. He occasionally has his therapy groups perform “depression operas,” with arias that go, “I’m really sad … I’m really really sad.” Other people put their worst thoughts on t-shirts, or send themselves emails that say, “Did you know you’re unlovable?” “You start playing with your own dark side and give yourself some distance from it,” Hayes said.

The process can seem perverse, since some of the patients’ fears—financial ruin, the death of family members—are quite serious. (To use my example, leishmaniasis is a serious scourge that afflicts poor people all over the world). But worrying obsessively about those things won’t prevent them from happening. They’re “unanswerable questions,” as Hayes calls them, and cycling through “what ifs” only gives them fuel. The point isn’t to suggest that the person’s worries aren’t scary, says Winston, it’s to develop “a different relationship with the thought.”

The therapists usually wait until they’ve seen their clients several times before suggesting Songify. How long it takes to work depends on the patient’s symptoms, but Hayes said he’s seen improvement within weeks. The person might not stop having the thought entirely, but they’ll no longer react to it with trepidation.

And because of Songify’s distinctive, robotic sound, they might even feel better right away.

Right after recording a Songify, Sisti said, “the person might say, ‘an hour ago, I was upset, and now I’m laughing.’”