Mel Brooks is a filmmaker synonymous with parodies. Though not all of his feature films are direct spoofs of specific films or genres, he made his name by skewering almost every convention of cinema. From Blazing Saddles to Spaceballs to Silent Movie, Brooks has achieved some of the best comic highs of any filmmaker. But his greatest parody of all also managed to tell a compelling story while making fun of its inspiration, the 1974 classic Young Frankenstein.

The idea for Young Frankenstein didn’t start with Brooks, though. As he recounted in a profile on the film for the Los Angeles Times, he saw Gene Wilder “scribbling something in his cowboy outfit” while they were filming Blazing Saddles. Wilder revealed to him the idea he had for Young Frankenstein, following the grandson of Mary Shelley’s iconic character Victor Frankenstein, and what it would be like if that character wanted nothing to do with the family legacy.

Though Brooks and Wilder were hard at work on Blazing Saddles, they brainstormed ideas for this new title that very night. “We knew we had to salute Mary Shelley as well as James Whale [the director of the 1932 Frankenstein],” Brooks said. That meant that Young Frankenstein, in spite of being a wild and goofy comedy where the good doctor’s faithful assistant Igor has a hump that keeps changing from one side of his back to the other, would be shot in black-and-white and supplied with set and production design deliberately inspired by both Frankenstein and Bride of Frankenstein.

That wasn’t all, though. As Brooks described in that Los Angeles Times profile, he even went to the lengths of finding the man who designed the electrical equipment used in the original Frankenstein, specifically so it could be used again in Young Frankenstein. Brooks’ preciseness about what would or wouldn’t make it into the film may seem at odds with his manic and ramshackle style, but as he pointed out, “My movies are not about jokes. They are about behavior, and behavior can be very funny.”

That’s not to say that Brooks always had the best instincts about the film. During the production, Wilder and Brooks tussled often over one very specific and memorable piece: when Frederick Frankenstein, who’s finally fully embraced his lineage and successfully revived a man from the dead, is joined by the Creature (the late Peter Boyle) in a performance of the song “Puttin’ on the Ritz." Brooks recounted in the Los Angeles Times that Wilder wanted the scene “to show the prowess of the talent of the monster. I said ... we can’t do that. It will make it silly.” But thanks to Wilder’s persistence and foresight, the scene stayed in the film and of course became one of its most beloved sequences.

Wilder’s vision extended to Brooks himself. When Wilder came up with the first pass at the script, he agreed to let Brooks do it with one important caveat. As Brooks mentioned in an interview at the A.V. Club, “I wasn’t allowed to be in it.” Wilder was specific, telling the co-writer and director that if he appeared in the film, Wilder wouldn’t. “He says, ‘You have a way of breaking the fourth wall, whether you want to or not. ... I don’t want too much to be, you know, a wink at the audience.’” Brooks does appear in a sense, though: in a scene where Frederick is being interrogated by Inspector Kemp (Kenneth Mars) while the two play darts, Frederick’s nerves get the best of him when he’s tossing darts left and right, once hitting and wounding an offscreen cat, whose yowl was provided by the director.

Young Frankenstein marked the arrival of a couple major players, too. Wilder, by this point, was an Oscar nominee for his work in Brooks’ The Producers and had already starred in Willy Wonka and the Chocolate Factory. And Boyle had appeared in some major films, such as the dark drama Joe. Madeline Kahn, as Frederick’s flaky fiancee Elizabeth, also had worked with Brooks on Blazing Saddles (where she got a Best Supporting Actress Oscar nomination). But Marty Feldman, well-known as a British comedian and TV performer, and Teri Garr got their first major film roles as Igor and Frederick’s laboratory assistant Inga, respectively.

As documented by the American Film Institute, Garr was one of literally hundreds of women to audition for the role of Elizabeth. At the time, Brooks wanted Kahn for the film, but to play Inga instead. When Kahn expressed a preference to play Elizabeth, not the assistant, Garr was chosen to play the ditzy blonde character, kickstarting a career that would soon send her to work on classics like Close Encounters of the Third Kind and Tootsie.

In the end, Young Frankenstein wound up being Mel Brooks’ second film of 1974, arriving in December nine months after. Blazing Saddles. Both of the films wound up with Academy Award nominations, too. (Though sadly the in-joke within Blazing Saddles, in which Harvey Korman as the nefarious Hedley Lamarr declares that he’s sure to get a Best Supporting Actor nod, never came true.) Though it may seem unlikely in the modern era, comedies were a lot more likely to garner Oscar nominations even back in the '60s and '70s. Brooks first won an Oscar for Best Original Screenplay with The Producers. While Blazing Saddles picked up three Oscar nods (also including ones for Best Original Song and Best Editing), Young Frankenstein got two nominations: Best Adapted Screenplay for Wilder and Brooks, and Best Sound.

Sadly, neither of Brooks’ 1974 comedies were successful at the Oscars, though Young Frankenstein did garner Hugo, Nebula and Saturn Awards for its script. Even more so than Blazing Saddles, Young Frankenstein has endured as much because it’s hilarious as because it’s a parody made out of love. Like The Producers, Young Frankenstein eventually spawned a Broadway musical of the same name, though it was never quite the earth-shaking stage hit that The Producers was.

The film’s comic legacy is still sterling and strong. Back in 2000, the AFI came up with a list of the 100 greatest comedies of all time, with Young Frankenstein coming in at No. 13. It’s one of three Brooks comedies to make the list, and it managed to be lowest of the three, with Blazing Saddles at No. 6 and The Producers at No. 11. And in 2003, Young Frankenstein was selected along with 24 other films to be part of the National Film Registry at the U.S. Library of Congress, thus preserving the film for being “culturally, historically or aesthetically significant," an honor it shares with those other two Brooks films.

Perhaps the most important legacy of Young Frankenstein is the one that Mel Brooks himself perceives. In the Los Angeles Times profile of the film on its 40th anniversary in 2014, Brooks stated “Young Frankenstein is by far the best movie I ever made. Not the funniest ... but as a writer-director, it is by far my finest.” The sly and clever exploration of a more modern version of the Frankenstein story may not be a laugh-a-minute comic riot like Blazing Saddles, but Young Frankenstein is one of the great parody films because it managed to skewer conventions while showing them respect instead of scorn.