One of the most memorable moments in Marvel cinematic history comes during the opening credits of Guardians of the Galaxy Vol. 2.

As the action kicks off, writer-director James Gunn choreographs a sequence that features Baby Groot (voiced by Vin Diesel) dancing to ELO’s 1978 hit Mr. Blue Sky.

The one-shot scene showcases the rest of the Guardians, led by Star-Lord/Peter Quill (Chris Pratt), battling a giant space octopus while Baby Groot shimmies and shakes on the cinematic dance floor.

It’s an intricate shot, and one that Gunn says he just put the finishing touches on less than a month ago.

“It took over two years of planning and acting out,” Gunn told the Sun in a recent interview. “I first came up with the shot when I was writing the treatment for the film. I had my associate producer Simon Hatt film me as Groot with an iPhone so we could stitch it together so that it would work perfectly.

“It was literally finished two weeks ago.”

In an interview with the Washington Post, Gunn revealed that he almost didn’t get the rights to Mr. Blue Sky because he cut a scene from the first Guardians movie that had featured the 1976 ELO hit Livin’ Thing.

"It was a whole montage around Livin' Thing, and it was awesome," Gunn told the Post. "To be honest, I think I regret cutting the montage from the movie. I think people would have loved it. I would have loved to put it even on (just) the Blu-Ray – but you have to pay hundreds of thousands of dollars for the song, and we couldn't afford to do that just for the Blu-Ray."

When he was asked about granting Gunn and company the rights to use Mr. Blue Sky, ELO’s leader Jeff Lynne initially balked. "He was hesitant because we had cut Livin' Thing."

But he eventually agreed to allow Gunn to use the track, which is a good thing since the music and the action marry perfectly in that opening shot.

via GIPHY

“The music is the most fun part of making the movie, not only because I love listening to songs and I love listening to songs while I write, but because I love having these songs that might have been forgotten or nearly forgotten and being able to turn kids today onto that music is exciting,” Gunn says. “To have a band like Alia Aliotta Haynes Jeremiah that sang Lake Shore Drive, which was just a regional hit in Missouri and Illinois, become a song that everybody all over the world is going to know is an awesome gift.

“I just wish I could choose more songs and turn people on to more music.”