Katy Perry decided to embrace her inner teenage girl when she sat down to write the title track from her forthcoming Teenage Dream album, out Tuesday. And she felt the only place she could get in touch with those warm, fuzzy feelings was her hometown of Santa Barbara, California.

The song, which she co-wrote with and was produced by Dr. Luke, Max Martin and Benny Blanco, recalls a simpler time when love felt like the first time. "Well, going to Santa Barbara, which isn't very far from L.A., it was just like it brought me back home and it took me out of this fast-paced L.A.," she told MTV News. "Everybody climbing on top of each other to get to that next step on the ladder ... sometimes L.A. can get exhausting."

In fact, it was that song that dictated how the entire album would play out. "I wanted to call it Teenage Dream because, really, there's a song on the record ... I wrote that song in Santa Barbara and it was a really pure moment for me because that's where I'm from. And it was where I started my creative juices, and it kind of exudes this euphoric feeling like everyone remembers what their teenage dreams were," she said. "All the girls that were on your poster walls ... and I want to continue to be one of those ... teenage wet dreams."

The track, however, wasn't all that easy to get right. "I'm in the studio fighting with them to change the melody, or I'm fighting for the best lyric at all times," she told Billboard earlier this year. "I think we rewrote 'Teenage Dream' five times for 10 days straight. On the last day, I was so happy to finally get somewhere that we all agreed on."

Perry said that there is a bottom line to the euphoria of the track. "That song is kind of like feeling that way when you were a teenager: really emotional, really invested. ... It's intense being in love and being a teenager. That's what 'Teenage Dream' is about."

Can you hear Katy's teenage angst in the song? Let us know in the comments!