Martin Scorsese's Goodfellas is an expertly written film, but that doesn't mean some great scenes weren't largely improvised. Scorsese is often held up as one of cinema's greatest directors, and while some films have been more successful than others, he has a catalog of great movies under his belt. Among that group, Goodfellas is generally considered to be at or near the top, and also rivals The Godfather and its sequel for the title of greatest gangster movie ever made.

Based on the real life of Henry Hill, Goodfellas boasts an excellent script by Scorsese and author Nicholas Pileggi, who wrote the non-fiction book Wiseguy that chronicles Hill's exploits. It's also got a great cast to perform said script, most notably the trio of Ray Liotta, Robert De Niro, and Joe Pesci. Still, many of the best directors realize that a great actor can do more than simply recite what's on the page, and can often tap into something more natural for their character.

Related: Goodfellas: Why Henry Hill Wasn't Killed By The Mob

When a performer truly connects with their character, magic can be made with a mostly or entirely improvised or ad-libbed scene. Goodfellas plays host to two such instances, the first being when Liotta's Henry makes the mistake of referring to Pesci's Tommy as being a "funny guy." Tommy, being the hot head that he is, takes offense, and Pesci improvised the majority of Tommy's dialogue in which he asks Henry "funny how?", demanding to know if he's considered a clown. The other largely improvised scene sees Henry, Tommy, and DeNiro's Jimmy head to Tommy's mom's house for dinner. Martin's mother Catherine Scorsese plays the mom, and does a lot of the improvising, having appeared in several of her son's movies.

Joe Pesci in Goodfellas

The real brilliance of why these two particular Goodfellas scenes were improved so much by being improvised is that they both go towards establishing the dynamics between the central characters, as well as seeing how these kinds of men behave when not committing crimes. The dinner scene featuring Catherine Scorsese, in particular, is a riot, with Tommy, Jimmy, and Henry exchanging playful banter, as well as Tommy acting like a much more pleasant person around his mother, wanting her to see the best in him even as she urges him to settle down and get married. The fact that this scene happens right after the three just murdered a made man adds an extra dark edge.

As for the "funny how" scene, it's in many ways the moment that really gets across just who Tommy is. A short, average-looking man not blessed with the suave attributes of people like Henry and Jimmy, Joe Pesci's Tommy DeVito is extremely concerned with how he's perceived by others, especially his mob colleagues. Tommy wants to be taken seriously, and his reaction to being called funny really illustrates how much of a ticking time bomb he is emotionally. He eventually tries to play it all off as a joke, but it sure didn't seem like he was initially. This sets the stage for what will happen later when Tommy goes off on Billy Batts and poor Spider. Tommy's Goodfellas story couldn't end any other way than it does, and the "funny how" scene makes that clear.

More: Goodfellas: Why Al Pacino Turned Down Playing Jimmy Conway