It’s been over a week since attendees at the world premiere of “Toy Story 5” were treated to a surprise debut performance of “I Knew It, I Knew You,” the original song by Taylor Swift. As the film concluded and audiences heard the song play over the end credits, the screen lifted to reveal Swift seated at a piano, giving the first live performance of the track.

But the surprises didn’t end there. After her performance, Swift introduced the film’s composer, Randy Newman, and together they performed the beloved and iconic song “You’ve Got a Friend in Me.”

Speaking with Variety, Newman revealed how the spontaneous duet came together. “They asked if I would mind if Taylor Swift did this thing, and I said, ‘No one’s ever going to say no to her,’” Newman explained. “We had an hour, maybe an hour and a half [to rehearse].” The composer wasn’t concerned about Swift not knowing the lyrics, as she’s a self-proclaimed lifelong fan of the franchise. “She knew the song. There wasn’t anything to do,” he said. However, Newman admitted to having one concern: he worried that one of the keys might be too high for her, as most of the song is written in E-flat major. He offered Swift an alternative. “I said, ‘Do you want to do it in another key?’ But she said no.”