No one could have predicted that a hip-hop-infused musical based on the life of Alexander Hamilton would become Broadway’s hottest ticket, but that’s exactly what happened when Lin-Manuel Miranda’s Hamilton debuted in July 2015. A movie version of the show, recorded with the original cast and titled Hamilton: An American Musical, hit Disney Plus on July 3; here are a few things you might not have known about Miranda’s take on the life and times of the first Secretary of the Treasury.

1. Hamilton was inspired by Ron Chernow’s biography of Alexander Hamilton.

Not long after his show In the Heights won four Tony Awards in 2008, Lin-Manuel Miranda went on vacation. Before he left, he picked up a biography called Alexander Hamilton. “I was just browsing the biography section. It could have been Truman,” he told 60 Minutes. “I got to the part where a hurricane destroys St. Croix, where Hamilton is living. And he writes a poem about the carnage and this poem gets him off the island.”

“That is part and parcel with the hip-hop narrative: writing your way out of your circumstances, writing the future you want to see for yourself,” Miranda told The New York Times. “This is a guy who wrote at 14, ‘I wish there was a war.’ It doesn’t get more hip-hop than that.”

Miranda recalled to Vogue that “I Googled ‘Alexander Hamilton hip-hop musical’ and totally expected to see that someone had already written it. But no. So I got to work.”

2. It took Miranda a year to write Hamilton’s first song—and another year to write the second song.

He performed the song, “Alexander Hamilton,” at the White House in 2009 (you can watch the video above). “From what I hear,” Questlove, who produced the cast album, told Billboard, “the president won't cease to let you know that: ‘The White House is where it began.’”

It took Miranda another year to craft Hamilton’s anthem, “My Shot.” “Every couplet needed to be the best couplet I ever wrote,” Miranda told 60 Minutes. “That’s how seriously I was taking it.”

3. Miranda wrote Hamilton’s lyrics on the move.

When he needed to come up with lyrics, he told Smithsonian, he walked. “For Hamilton what I’d do is write at the piano until I had something I liked,” he said. “I’d make a loop of it and put it in my headphones and then walk around until I had the lyrics. That’s where the notebooks come in, sort of write what comes to me, bring it back to the piano. I kind of need to be ambulatory to write lyrics.”

4. Hamilton started as a mixtape, not a musical.

Initially, Miranda said he was working on a concept album inspired by the life of Alexander Hamilton called The Hamilton Mixtape. “I always had an eye toward the stage for the story of Hamilton's life, but I began with the idea of a concept album, the way Andrew Lloyd Webber's Evita and Jesus Christ Superstar were albums before they were musicals,” Miranda recounted to the Hollywood Reporter. “And I built this score by dream casting my favorite artists. I always imagined George Washington as a mix between Common and John Legend (a pretty good description of Christopher Jackson, actually, who plays our first president); Hercules Mulligan was Busta Rhymes; and Hamilton was modeled after my favorite polysyllabic rhyming heroes, Rakim, Big Pun, and Eminem.”

The reason, he told The New York Times, was because “I wanted to be a little more selfish with this—I wanted the lyrics to have the density that my favorite hip-hop albums have … It was easier to think of it as a hip-hop album, because then I could really just pack the lyrics. [But] I only know how to write musicals.” He performed 12 musical numbers from The Hamilton Mixtape at Lincoln Center’s American Songbook series in January 2012; he began workshopping the show in 2014. It played The Public beginning in January 2015 and made the jump to Broadway in July 2015 (it officially opened in August).

5. Miranda did his research—both historically and musically—to write Hamilton.

In addition to reading Chernow’s biography of Hamilton, Miranda read Hamilton’s letters and works and visited sites important to the American Revolution in New York City. He explained to The Atlantic that, to understand Burr, he read The Heartbreak of Aaron Burr by H.W. Brands, and to nail the dueling code of the day, he picked up Affairs of Honor by Joanne Freeman. He wrote, for a time, at the Morris-Jumel Mansion, which Washington once used as a headquarters during the Revolutionary War. In October 2014, before the show began playing at The Public, he and director Thomas Kail went to the Weehawken, New Jersey, dueling ground where Burr shot Hamilton (the actual dueling grounds are covered by train tracks now, but there is a small memorial there).

Miranda also looked at other musicals before diving into Hamilton, like Jesus Christ Superstar and Les Miserables. “I really got my Les Miz on in this score, like being really smart about where to reintroduce a theme,” he told The New Yorker. “In terms of how it accesses your tear ducts, nothing does it better than that show.”

6. Ron Chernow was a historical consultant for Hamilton.

Miranda met Chernow before he performed the song that would become “Alexander Hamilton” at the White House (in fact, he sang the song to Chernow in the biographer’s living room), and soon Chernow became a consultant on the show. “[Miranda] was smart enough to know that the best way to dramatize this story was to stick as close to the facts as possible,” Chernow told 60 Minutes.

“I’m theater people, and theater people, the only history they know is the history they know from other plays and musicals,” Miranda told The Atlantic. “So to that end, I felt an enormous responsibility to be as historically accurate as possible, while still telling the most dramatic story possible. And that’s why Ron Chernow is a historical consultant on the thing, and, you know, he was always sort of keeping us honest. And when I did part from the historical record or take dramatic license, I made sure I was able to defend it to Ron, because I knew that I was going to have to defend it in the real world. None of those choices are made lightly.”

According to Smithsonian, Chernow looked at every draft and every song and assessed everything for accuracy.

7. Hamilton wasn’t always sung through.

Hamilton is sung and rapped from start to finish, but it wasn’t always that way. “We actually went down the road with a playwright,” Miranda told Grantland. “There’s a version of Act 1 where we had songs and they were the songs that are in the show, but we found that if you start with our opening number, you can’t go back to speech. The ball is just thrown too high in the air.”

8. One scene from Hamilton didn’t make it onto the soundtrack.

The show features one scene that isn’t sung, and which Miranda kept off of the cast album: In “Tomorrow There’ll Be More of Us,” which takes place between “Dear Theodosia” and “Non-Stop,” Hamilton finds out that his friend Laurens has been killed. “I made a decision not to record this scene on the album, for two reasons,” Miranda wrote on Tumblr:

”1) It really is more of a scene than a song, the only SCENE in our show, and I think its impact is at its fullest in production form. 2) As someone who grew up ONLY listening to cast albums (we ain’t have money for a lot of Broadway shows, like most people) those withheld moments were REVELATIONS to me when I finally experienced them onstage, years later. Hamilton is sung through, and I wanted to have at least ONE revelation in store for you. I stand by the decision, and I think the album is better for it.”

9. Miranda wrote King George’s song in Hamilton, “You’ll Be Back,” on his honeymoon.

Because he’s an interloper on the proceedings of Hamilton, King George’s song, “You'll Be Back,” is quite different from the rest of the show’s numbers. “It’s a throwback to a sixties Beatles tune,” Jonathan Groff, who plays King George, told Vogue. “And it’s a breakup song between America and England, which is fabulous. He’s like, ‘You’re leaving me? Oh, really? Well, good luck with that.’” Miranda wrote the song while on his honeymoon in 2010 “without a piano around,” he told Grantland.

10. The original version of the Hamilton song “My Shot” had an extra verse for Hercules Mulligan.

“I’m Hercules Mulligan, a tailor spying on the British Government / I take the measurements, information and then I smuggle it / Up to my brother's revolutionary covenant / I’m running with the Sons of Liberty, and I’m loving it,” Mulligan raps. At that point, neither the Marquis de Lafayette nor John Laurens were part of the song. You can hear the rest of the demo here; portions of Mulligan’s verse ended up in “Yorktown (World Turned Upside Down).”

11. Miranda wrote “Wait for It” on the subway.

“I was going to a friend’s birthday party in [Brooklyn],” he said, when a lyric from the chorus to Aaron Burr’s song, “Wait for It,” came to him. “I sang the melody into the iPhone, then I went to the guy’s party for 15 minutes, and wrote the rest of the song on the train back home.”

12. The rap in “Guns and Ships” is really, really fast.

“I believe that form [rap] is uniquely suited to tell Hamilton’s story, because it has more words per measure than any other musical genre,” Miranda told 60 Minutes. “It has rhythm, and it has density, and if Hamilton had anything in his writing, it was this density.” The use of rap helps Miranda pack more than 20,000 words into two and a half hours—roughly 144 words per minute, according to Leah Libresco at FiveThirtyEight. “If Hamilton were sung at the pace of the other Broadway shows I looked at, it would take four to six hours,” Libresco wrote. She found that the musical’s fastest paced verse, from the song “Guns and Ships,” clocked in at 6.3 words per second.

13. Hamilton’s songs sample rap music and reference rap songs—as well as other musicals.

As a show that has its roots in rap, it’s not surprising that Miranda has peppered Hamilton with rap references and samples: “My Shot” has elements of Mobb Deep’s “Shook Ones Part II” and an homage to Notorious B.I.G.’s “Going Back to Cali”; the song “Ten Duel Commandments” samples B.I.G.’s “Ten Crack Commandments”; the opening to “Cabinet Battle #1” references Jay-Z’s “Izzo (H.O.V.A.)” and contains parts of “The Message” by Grandmaster Flash; “Meet Me Inside” contains elements of DMX’s “Party Up in Here (Up in Here)”; and “Cabinet Battle #2” references B.I.G’s “Juicy (It’s All Good).” These themes—and samples—show up in other songs throughout Hamilton.

Miranda pays homage to Broadway shows, too: He snatched a line from South Pacific for Burr (“I’m with you but the situation is fraught / You’ve got to be carefully taught,” in “My Shot”), makes reference to the song "Modern Major General" from Pirates of Penzance (when Washington sings, “I’m the model of a modern major general / the venerated Virginian veteran whose men are all / Lining up, to put me on a pedestal,” in “Right Hand Man”), and put parts of “Nobody Needs to Know” from The Last Five Years in “Say No to This.”

Miranda’s lyrics are also packed with historical references. We decoded a few here, and many are annotating the lyrics on Genius (Miranda himself has also weighed in there). Miranda also wrote his own book of annotated lyrics, which he tweeted are “Not what you'd find on Genius, just things in my brain & heart.”

14. At first, Miranda couldn’t decide if he wanted to play Hamilton or Burr.

“I feel an equal affinity with Burr,” he told The New Yorker. “Burr is every bit as smart as Hamilton, and every bit as gifted, and he comes from the same amount of loss as Hamilton. But because of the way they are wired Burr hangs back where Hamilton charges forward. I feel like I have been Burr in my life as many times as I have been Hamilton.” But eventually, he chose Hamilton: “When I get called in for stuff for Hollywood, I get to be the best friend of the Caucasian lead. If I want to play the main guy, I have found, I have to write it ... [As Hamilton], I get to be cockier than I really am; I get to be smarter than I really am; I get to be more impulsive than I really am—it’s taking the reins off your id for two and a half hours.”

Burr was played by Leslie Odom Jr. “I stupidly gave him a lot of the best songs,” Miranda told Grantland. “‘Wait for It’ and ‘The Room Where It Happens’ are two of the best songs I’ve ever written in my life and he got them both.”

15. Casting people of color in Hamilton’s main roles was a deliberate choice.

“Our goal was: This is a story about America then, told by America now, and we want to eliminate any distance—our story should look the way our country looks,” Miranda told The New York Times. “Then we found the best people to embody these parts. I think it’s a very powerful statement without having to be a statement.” The only main character played by a white actor is King George.

“When I think about what it would mean to me as a 13-, 14-year-old kid, to get this album or see this show—it can make me very emotional,” Odom told The New York Times.

Later, Hamilton's producers would say that, "It is essential to the storytelling of Hamilton that the principal roles, which were written for nonwhite characters (excepting King George), be performed by nonwhite actors."

16. Miranda cut George Washington’s death from Hamilton.

Initially, Washington’s death was in the show—but Miranda cut it. He tweeted:

“One cut line... BURR: And in our grief-

HAMILTON/JEFFERSON: He unites us one last time.”

“It was a cut musical moment, & actually began with Burr singing, ‘I hear wailing in the streets…,’” Miranda continued. He cut it, he said, “because we sing a whole song about him saying goodbye and even though the moment gave us feels, it was redundant.”

17. One of the most important characters in Hamilton is “The Bullet.”

One of the first characters to die in the show is a spy, who, after the song “You’ll Be Back,” is discovered by a British soldier who breaks her neck. The spy is played by Ariana DeBose, and after her on-stage execution, she becomes a character known as The Bullet—who is essentially death personified. As PopSugar notes, The Bullet foreshadows many of the show’s deaths: In “Yorktown,” she shakes hands with John Laurens, who dies not long after; in “Blow Us All Away,” she flirts with Philip Hamilton, who later dies in a duel with George Eacker. And before she delivers the round that fatally wounds Hamilton in “The World Was Wide Enough,” she has several interactions with the title character.

18. The lottery for Hamilton tickets featured its own show.

#Ham4Ham—as the show was called—regularly featured members of Hamilton’s cast as well as other Broadway performers; it took place on the street outside the Richard Rodgers theater. Among other things, Miranda dueted with Broadway star Lea Salonga; answered audience questions with just Les Miz lyrics; showed his love for the show’s tech people by running the entire cast through a number while the cues were called; presided over the three actors who have played King George lip syncing a song from the show; and hosted a contest to see which Hamilton fan could nail the Lafayette rap in “Guns and Ships.” Miranda put on the show, he told Rolling Stone, because he knew that most of the hundreds of people who lined up for the lottery wouldn’t win, and he didn’t want them to walk away with nothing.

19. Hamilton’s set is symbolic.

Hamilton set designer David Korins told the Washington Post that when designing the set, he decided on something that looked like an unfinished, mid-construction colonial-era building. “This is the story of the people who built the scaffolding upon which the country was built, so you see wooden period scaffolding up around a half-made wall to show a kind of aspirational space,” he said. The turntables in the stage, meanwhile, were, according to the Post, “inspired by the whirlwind of history that sweeps up Hamilton, as well as the literal hurricane that hits the Caribbean island where he was born.”

The set changes between acts—the brick walls (which are actually made of plastic and wood) behind the scaffolding get 8 feet taller, “because the country is progressing and that foundation is getting bigger,” Korins told WaPo. Quills and parchment replace the rifles hanging on the walls, “because the war is over and now it’s time to govern.”

20. Running up and down the stairs of the Hamilton set can be exhausting.

When James Monroe Iglehart—who had previously played the Genie in Broadway’s Aladdin—stepped into the roles of Lafayette and Jefferson in Hamilton in 2017, he told Mental Floss that the toughest part of the show wasn’t necessarily what one would expect. “The French accent is not the hardest, it’s not the speed of the lyrics, it’s not the show—it is the stairs,” he said. “There are stairs going up, and then there are stairs going down. And there’s stairs going down onstage, stairs going off. What you don’t see are the two sets of stairs behind. So my first act as Marquis de Lafayette, I walk up the steps, I walk down the back steps, I dip the jacket, walk back on, walk up the steps again, walk down the steps. There’s one song I walk up the steps four times. Between ‘Helpless’ and ‘Satisfied’ I walk up the steps six times, because we have to rewind. My calves were like, ‘What are you doing?’ I mean, I did a cartwheel eight times a week and tap danced in Aladdin. But on this show, I cussed—I was like, ‘What’s up with this Stairmaster show you guys built?’”

21. Celebrities who came backstage signed a life-sized cutout of Hamilton.

Here's a joyous thing.

My new boss John Lasseter was here last night.

Look what he made us. pic.twitter.com/0Yfsac07LG — Lin-Manuel Miranda (@Lin_Manuel) November 14, 2015

Jennifer Lopez, Danny DeVito, Steven Spielberg, Sting, Jon Lasseter, Oprah, Vice President Joe Biden, and more put their kind words—and their John Hancocks—on and around Hamilton.

22. The stars of Hamilton helped raise money for the orphanage Eliza Hamilton started.

In 1806, Eliza Hamilton was one of the founders of New York City’s first private orphanage; these days, it’s called Graham Windham. Miranda and Philippa Soo, who played Eliza in Hamilton, performed at an event to raise money for the organization. “What a time at the @GrahamWindham luncheon today,” he tweeted. “When the kids (from ELIZA'S ORGANIZATION) sang ‘Eliza, you have done enough.’ I mean…”

23. Barack Obama is a huge fan of Hamilton.

President Obama called the show “brilliant,” adding, “so much so that I’m pretty sure this is the only thing that Dick Cheney and I have agreed on—during my entire political career.”

24. Hamilton has Stephen Sondheim’s seal of approval.

At some point, Miranda showed his songs to Stephen Sondheim, the man behind Into the Woods, Sweeney Todd, and many more musicals, who told The New York Times, “He sent me lyrics printed out, and recordings of the songs. This raised obvious red flags: I worried that an evening of rap might get monotonous; I thought the rhythm might become relentless. But the wonderful thing about Lin-Manuel’s use of rap is that he’s got one foot in the past. He knows theater … Hamilton is a breakthrough … We’ll certainly see more rap musicals. The next thing we’ll get is Lincoln set to rap. If you think I’m kidding, talk to me in a year.”

25. Miranda recruited other artists for The Hamilton Mixtape and a series of “Hamildrops.”

In October 2015, Miranda tweeted: “So the show is done. Cast album is out. Now we begin planning The Hamilton Mixtape. Remixes & Covers & Inspired bys. FOR REAL. GET READY. I was originally trying to get the mixtape done with Atlantic before we opened, but that's like performing surgery while having a baby.”

The 23-song mixtape featured artists from The Roots, Queen Latifah, and Ashanti and Ja Rule to Kelly Clarkson, Usher, and Ben Folds and Regina Spektor covering songs from the show, as well as demos of songs that didn’t make the cut. There’s a demo detailing the horrors the Continental Army faced at Valley Forge and a third, unreleased rap battle, “where Ham, Mad & Jeff go IN on slavery,” Miranda tweeted. “It was sort of our homage to ‘Hail Mary’ [by Tupac Shakur],” he told Billboard.

Following the mixtape, Miranda announced a series of what he called “Hamildrops.” They featured “Ben Franklin’s Song” by the Decembrists, “The Hamilton Polka” by Weird Al Yankovich, an extended version of “Dear Theodosia” sung by Sara Bareilles, and a remix of “One Last Time” featuring Barack Obama.

26. There are a few ways to interpret Eliza’s gasp at the end of Hamilton.

At the end of “Who Lives, Who Dies, Who Tells Your Story,” Eliza sings about her quest to ensure Hamilton’s legacy: “And when my time is up, Have I done enough? Will they tell your story? Oh, I can't wait to see you again. It's only a matter of time.” Alexander takes her hand, leads her around the stage, and then she steps to the edge of the stage, looks up—and gasps.

That moment isn’t written into the script, and Hamilton fans have long debated what, exactly, this gasp means. Some think it’s that Eliza has died and is seeing Hamilton waiting for her on the other side. Others believe that what Eliza is seeing is the audience itself—and the gasp is Eliza understanding that she succeeded in passing on his story.

"People are like, 'Is it Eliza going into heaven? Is she seeing Alexander? Is she seeing God? What is it?' And it’s kind of all of those things,” Soo said in a 2016 interview. “Sometimes, it’s literally, I look out and I see the audience, and that’s what it is, but I think that idea of 'transcendence' is present in all of that."

Miranda himself recently said that the gasp is “different for each Eliza. I’ve had different conversations. It’s heart-stopping, isn’t it? And I do think that it traverses time in some way, whether that thing she’s seeing is Hamilton, whether that thing she’s seeing is heaven, whether that thing she’s seeing is the world now. I think those are all valid and all fair—I think she’s seeing across a span of time in that moment.”

One thing is for certain: Miranda is not playing himself in the final moments, leading Eliza to look out at the audience, as one fan theorized. “It’s a lovely notion … but it breaks down the moment I’m not playing the role,” Miranda tweeted. “The Gasp is The Gasp is The Gasp. I love all the interpretations.”