Woody Allen won his first two Oscars (for Best Director and Best Original Screenplay) for 1977's Annie Hall, which changed the rules of the romantic comedy. But not everyone was a fan of this groundbreaking Best Picture—including Allen himself. To celebrate its 40th anniversary, here are a few things you may not know about its behind-the-scenes story.

1. ALLEN’S ORIGINAL IDEA FOR THE MOVIE WAS ENTIRELY DIFFERENT.

Although Annie Hall is now heralded as one of the most influential and inventive romantic comedies of all time, director and co-writer Woody Allen’s original mission was not to make a relationship picture. Allen and his writing partner, Marshall Brickman, instead conceived of the story as a general exploration of the main character’s life and psyche, which was to to be filled with romantic, mysterious, and fantastical subplots in equal parts.

The project, reflecting protagonist Alvy Singer’s persistent malaise, was first titled Anhedonia, a somewhat archaic psychiatric term referring to the inability to feel joy. The first cut of the movie ran about 140 minutes—almost 50 minutes longer than the final version.

2. EARLY DRAFTS CONTAINED A SLEW OF FANTASY ELEMENTS.

Included among the original script’s fantasy scenes and dream sequences were Alvy and Annie’s time-hopping visits to the Garden of Eden, the French Resistance, and Nazi Germany, parodies of the films Angel on My Shoulder and Invasion of the Body Snatchers, a guided tour of Hell (featuring Richard Nixon), and a basketball game between the New York Knicks and philosophers like Friedrich Nietzsche and Søren Kierkegaard.

3. ONE DISCARDED SUBPLOT FROM ANNIE HALL BECAME ANOTHER MOVIE.

The Annie Hall scene following Alvy and Annie’s last-minute decision to skip out on the Ingmar Bergman film Face to Face was initially meant to kick off a sequence in which the pair witnesses and investigates a murder. The story would later be recycled as the premise of 1993's Manhattan Murder Mystery, which again stars Allen and Keaton as a romantic couple.

4. THE STUDIO HIRED AN AD AGENCY TO MAKE ALLEN’S TITLE MORE MARKETABLE.

United Artists

United Artists, the distributor of Allen’s four previous films (Bananas, Everything You Always Wanted to Know About Sex But Were Afraid to Ask, Sleeper, and Love and Death) recognized the inherent difficulty in marketing a film called Anhedonia. In an effort to make Allen’s desired title more palatable, the studio hired an advertising agency to fill local newspapers throughout the country with headlines reading, “Anhedonia Strikes __________!” (filling in the blank with the name of the city in which the ad would publish). However, the million-dollar campaign was scrapped before execution, as United Artists successfully convinced Allen to change the film’s title.

5. ULTIMATELY, THE FILM WAS NAMED AFTER ITS LEAD ACTRESS.

After a few regrettable title suggestions from Brickman (A Rollercoaster Named Desire, It Had to Be Jew, and Me and My Goy) and a couple of somewhat bland options by Allen (Anxiety and Alvy and Me), the movie wound up inheriting the name of its heroine: Annie Hall, a character named after the actress who portrayed her. Diane Keaton’s birth name was Diane Hall, and she went by “Annie.”

6. ALLEN HATED ONE SCENE SO MUCH HE THREW IT INTO THE EAST RIVER.

Although Allen grieved the loss of most of the material that didn’t make it to the screen, there was one sequence he was glad to be rid of: A late-in-film fantasy bit in which a sentient traffic light convinces Alvy to fly across country and win Annie back. Allen thought the scene was so disgustingly cutesy that he allegedly tossed the prints into New York City’s East River.

7. ANNIE HALL’S COSTUME DESIGNER ALMOST COST AMERICA A FASHION TREND.

United Artists

The “Annie Hall look” became a tremendous fashion craze following the release of the film, as women in the late 1970s began to mimic the character’s appropriation of “menswear” (bowler hats, coats and blazers, baggy pants, and neckties) as newly feminine garments.

Keaton herself supplied most of Annie’s wardrobe—the actress ordinarily dressed this way. According to Allen, Annie Hall’s costume designer Ruth Morley reportedly attempted to deter the actress from such unorthodox attire, deeming the look “crazy,” but ultimately lost that battle.

8. THE FILM EMPLOYS A VERY LOW-TECH VERSION OF SPLIT SCREEN.

Annie Hall is celebrated for its innovative utilization of split screen—specifically in one scene in which both Alvy and Annie are meeting with their respective shrinks—but the process behind the device was particularly "old fashioned" (almost pre-technological). Cinematographer Gordon Willis actually set up a thin wall between adjacent sets to shoot both halves of the divided scene in tandem.

9. ALLEN’S COCAINE-INDUCED SNEEZE WAS THE REAL THING.

One of the biggest laughs in early screenings of Annie Hall came upon watching Alvy’s voluminous sneeze spread a container of cocaine around the living room of his flustered friends. It’s tough to imagine a better way of capping such a sequence, but in fact the moment was born on set: The sneeze was real and unexpected, and stayed in the movie thanks to test audiences’ resultant delight.

10. ANNIE HALL’S SCENES WERE MORE THAN TWICE AS LONG AS THE AVERAGE 1977 FILM’S.

Generally speaking, a film’s average scene length is directly related to the complexity of the material it showcases—longer scenes allow for more intricate conversations and greater opportunities for cinematic experimentation. Critic David Bordwell, who highlighted Allen’s work in a 2002 study pertaining to the scene length of Hollywood movies, determined Annie Hall’s average scene to run for approximately 14 seconds, between two and three-and-a-half times as long as that of the typical 1977 movie (estimated as somewhere in between four and seven seconds).

11. THE “TRUMAN CAPOTE LOOKALIKE” IS TRUMAN CAPOTE.

A memorable scene in the film observes a crowd of Manhattan passersby as Alvy and Annie trade quiet jabs at the strangers’ expense. Alvy deems the final subject in this lot, “The winner of the Truman Capote lookalike contest.” The man in question is actually the Breakfast at Tiffany’s author himself.

12. THE FILM HAS A STRANGE CONNECTION WITH ANOTHER 1977 MOVIE.

Annie Hall is recognized as a launch pad for the careers of several then-unknown actors who’d go on to enjoy prosperous careers in Hollywood. Christopher Walken (as Annie’s disturbed brother Duane), Jeff Goldblum (as a Los Angeles partier who forgets his spiritual mantra), and Beverly D’Angelo (as an actress in the canned laughter sitcom starring Alvy’s friend Rob) all played pre-fame supporting parts in the film. Coincidentally, all three of these actors also appeared in the Brooklyn-set horror movie The Sentinel, which was released in American theaters three months before Annie Hall.

13. ALLEN CAME UP WITH THE ENDING IN A CAB ON THE WAY TO PREVIEW THE FILM.

As Annie Hall had changed so much between its conception and production, Allen and Brickman had trouble coming up with an appropriate ending. The pair struggled with this dilemma all the way up through the earliest preview runs of the movie, at which point they had settled on an emotionally unfulfilling “downer ending” that closed on an awkward post-breakup encounter between Alvy and Annie. During a cab ride to one of these previews, Allen had an epiphany: He scribbled down a few notes that quickly blossomed into Alvy’s beloved “We need the eggs” speech that closes the film.

14. ADJUSTED FOR INFLATION, ANNIE HALL IS ALLEN’S HIGHEST GROSSING MOVIE BY FAR.

In 1977, Annie Hall made $38,251,425 at the box office, which makes it the director’s fourth highest grossing film (behind Manhattan, Hannah and Her Sisters, and Midnight in Paris). Adjusted for inflation, Annie Hall’s ticket sales equate to a whopping $139.3 million in 2015 dollars, passing his next best adjusted-for-inflation picture, Manhattan, by more than $10 million. (And more than doubling Midnight in Paris’ $57.7 million take.)

15. ALLEN DOESN’T LIKE ANNIE HALL.

Despite its four Academy Awards—for Best Picture, Director, Original Screenplay, and Actress—and cultural legacy, Annie Hall has yet to win over Allen. The director insists that the film is merely a shell of his grander original vision. "In the end, I had to reduce the film to just me and Diane Keaton and that relationship," he once noted. "So I was quite disappointed in the end of that movie, as I was with other films of mine that were very popular." He’s also not particularly fond of his 1979 film Manhattan. (And yet, somehow, he’s never outwardly decried Scoop…)