Goodfellas has various unforgettable scenes, among those the one where Tommy DeVito asks Henry Hill “how am I funny?”, which was based on a real situation that happened to Joe Pesci. Although Martin Scorsese has explored various genres throughout his career, he continues to be best known for his gangster movies, and the one often regarded as the best is Goodfellas.

Based on the book Wiseguy by Nicholas Pileggi, Goodfellas chronicles the life of mob associate Henry Hill (Ray Liotta), from his days as a teenager fascinated by the mafia presence in his neighborhood, to his involvement with the crime family of Paul Cicero (Paul Sorvino). Henry becomes acquainted with various gangsters, most notably Jimmy Conway (Robert DeNiro) and Tommy DeVito (Joe Pesci), working with them on various occasions. During the first third of Goodfellas, as viewers and Henry get to know these mobsters better, he has a potentially dangerous altercation with Tommy, when Henry tells him that he’s “funny”.

Related: Goodfellas: What Being A Made Man Means (& Why Henry Hill Can't Be One)

The scene takes place at a restaurant, with Henry and others listening to one of Tommy’s stories. As everyone laughs, Henry tells Tommy that he’s a funny guy, which Tommy doesn’t take well. Tommy questions Henry about it, asking how he is funny. As tension builds up, Henry tries to explain himself and Tommy keeps pushing him about it, asking if he sees him as a “clown” and someone who is there to “amuse him”. After a brief moment of silence (that surely feels like an eternity in a situation like that), Henry breaks into a laugh, with Tommy revealing he was just messing with him and “almost had him”. Seconds later, Tommy has another one of his anger bursts against the man in charge at the restaurant, with Henry calling him funny again (and later a third time), now prompting a less serious reaction from Tommy. This has become one of the most iconic scenes from Goodfellas, and it’s based on something that happened to Pesci while working at a restaurant.

Joe Pesci enjoying a drink in Goodfellas

When Pesci was young, he worked as a waiter at a restaurant. While attending a mobster, he made a compliment by saying he was “funny”, but the comment wasn’t taken well. When working on Goodfellas, Pesci shared this anecdote with Scorsese, who liked it so much he decided to add it to the film. However, he didn’t include it in the shooting script, so only Pesci and Liotta knew what was happening in the scene, and it was improvised and rehearsed by them, but kept a secret from the rest of the actors in the scene in order to catch their genuine reactions.

The result is one of the best scenes in Goodfellas, as it’s not only a suspenseful moment but also one that says a lot about the character of Tommy DeVito, who was impulsive and had anger issues. Tommy also had those abrupt mood swings, which more often than not resulted in someone getting hurt. For those watching Goodfellas for the first time, it might seem like Henry is going to get out of the restaurant with, at least, a black eye, but the scene quickly takes a turn that ultimately adds a lot to both characters and helps viewers get to know Tommy a lot better.

Next: Goodfellas: How The Gambino Crime Family Knew Tommy Killed Billy Batts