"Good Will Hunting" is turning 20 -- how do you like them apples?

Released on December 5, 1997, the drama about a tormented young genius from blue-collar Southie famously transformed relative unknowns Matt Damon and Ben Affleck into Oscar-winning Cinderellas. It finally made Robin Williams an Academy Award-winner, too -- while spawning a wave of Baahston-set movies that continues to this day. The movie was such a huge hit that, um, its good will has carried Damon and Affleck throughout the rest of their careers.

As many times as you've watched prodigy Damon dazzle at the chalkboard, woo Harvard co-ed Minnie Driver, and joust with therapist Williams, there's still plenty you may not know about "Good Will Hunting," from the spy thriller it almost became, to the real-life romances behind the story, to the controversy in the film's wake that helped launch Mindy Kaling's career.
1. The "GWH" script started out as a project Damon wrote for a drama class before he dropped out of Harvard to appear in "Geronimo: An American Legend." When he arrived in Los Angeles, he enlisted Affleck, who had already moved there, to help him flesh out his 40-page first act into a full screenplay.

2. For a long time, the two writers never had a proper title or even a name for their protagonist. (For a while, he was called "Nate.") The title "Good Will Hunting" came from their high school friend Derrick Bridgeman's unproduced screenplay. They bought the rights to use the title for $10,000 and later gave Bridgeman a cameo as an MIT student.
3. When the screenplay first sold to Rob Reiner's production company, Castle Rock, it was a spy thriller, in which Will is the now-familiar janitor prodigy who hangs out with his pals from the neighborhood, but who also spends time outsmarting government intelligence agencies. Reiner sat the screenwriters down and told them they had two great stories there, which was one too many, and that they should decide whether they wanted the character material or the thriller.

4. Reiner had them meet with his frequent screenwriter, William Goldman, who echoed Reiner's advice and recommended that they drop the spy material. (A hint of it remains in Will's monologue about why he doesn't want to apply for a cryptography job at the National Security Agency.) It was this meeting that led to rumors later that Goldman was "GWH"'s true author, rumors Goldman has repeatedly denied.
5. The Castle Rock deal netted the fledgeling screenwriters $650,000. The two Boston boys had no credit history, but they showed the Variety report of their deal to a realtor in order to qualify to rent a $3000-a-month house in Los Angeles.

6. After they rewrote their script, they still insisted on starring in it and even wanted to direct it themselves. Castle Rock balked, but the company offered to let the pair out of their deal if they could find another buyer. But they had only 30 days, and after that, not only would Castle Rock get to keep the screenplay, but it would cast other stars, actors more bankable than the little-known Affleck and Damon. 7. Now, every producer who'd participated in the initial bidding war for the screenplay was turning them down. Affleck later used these rejections as inspirations for some of the Hollywood scenes in his Oscar-winning movie "Argo."

8. Affleck had appeared in twomovies directed by Kevin Smith, and he approached Smith about directing "GWH." Smith thought the script was so good, that it should be directed by someone a lot more skilled than himself. Still, he took an executive producer title and brought it to the attention of Miramax.
9. About halfway through the screenplay, Damon and Affleck had written a scene where Will and therapist Sean suddenly start having sex. The pornographic scene was just there as a test to see if any of the Hollywood power brokers they'd showed the screenplay to had read that far. The person in charge of Miramax at the time was the only one who noticed the scene and told them to scrap it. Which is how "GWH" became a Miramax movie.

10. Attached early on was Mel Gibson, who'd just won an Oscar for directing "Braveheart." Damon and Affleck hadn't yet seen it, but they were encouraged to lie and tell Gibson they'd loved it. Unfortunately, Gibson spent so long letting the script linger in development limbo that Damon and Affleck worried that they'd be too old for their roles. They had a talk with Gibson, who agreed to let the project go.
11. One talented director Damon and Affleck respected was Gus Van Sant. Damon had auditioned unsuccessfully for a role in Van Sant's "To Die For" (Van Sant cast Joaquin Phoenix instead), but Ben's brother, Casey, had landed a part in the film. Van Sant signed on to direct "GWH," but the project languished for another year as Van Sant and Harvey Weinstein argued over who'd get final cut.

12. What broke the logjam and propelled the movie into production? First, Francis Ford Coppola cast Damon in the lead role of his adaptation of John Grisham bestseller, "The Rainmaker." That suddenly made Damon into a potential bankable star. Second was the casting of Robin Williams as shrink Sean Maguire. Williams had just starred in Coppola's "Jack," and he signed on to work with Damon and Affleck after the legendary director vouched for Damon.
13. Will's love interest, Harvard pre-med student Skylar, was named after a classmate Damon had dated at Harvard, pre-med Skylar Satenstein. During the shoot, he began dating Minnie Driver, the actress playing Skylar. The real Satenstein went on to marry Metallica's Lars Ulrich.

14. Williams accompanied Affleck and Damon on location-scouting trips throughout Boston. On one trip, as they approached the State House (the Massachusetts capitol building), they discovered that Steven Spielberg was inside, filming "Amistad." Williams wanted to stop by and visit his famous friend. Fans mistook the bearded, sunglasses-wearing actor for Spielberg, so he signed autographs while impersonating the director.
15. Some Boston exterior locations proved tricky. Harvard seldom lets anyone shoot a movie on campus, but a phone call from a more distinguished Harvard alumnus than Damon -- John Lithgow -- persuaded the University to let them shoot a few outdoor scenes. An outdoor shot down the road at MIT disrupted a student bake sale, sparking an angry tirade by the professor in charge of the students' department. The location manager had to distract him long enough for Van Sant to get his shot.

16. Similarly, the Boston Red Sox seldom allow their logos or Fenway Park to appear in an R-rated movie, but Affleck and Damon were determined to keep their dialogue colorfully profane and true-to-life, while still using footage of Carlton Fisk's 1975 World Series home run -- a key moment in Sean's story of how he met his wife. The producers went ahead and used the footage anyway, but offered to let the Sox censor the sequence if they didn't like the movie. Fortunately, the ball club relented.
17. The pivotal scene between Williams and Damon, sitting on a bench in Boston's Public Garden, was also tricky to film. That's because 3,000 Williams fans, including Boston Mayor Thomas Menino, showed up at the park, and the police strained to keep them quiet and out of camera range.

18. Affleck and Damon wanted the L Street Tavern, a real-life Southie institution, to serve as the pub frequented by Will and his crew. Williams had no scenes there, but after he paid the bar a late-night visit, the Tavern agreed to let the filmmakers shoot there, even though the patrons Williams won over had nearly beaten up Affleck for wearing his baseball cap backwards.
19. Interiors, including classroom scenes and Sean's office, were shot largely in Toronto.

20. Van Sant thought it would raise the emotional stakes late in the film to have Affleck's Chuckie die in a construction accident. Affleck and Damon objected, but they wrote Chuckie's death into the script anyway. Reading the new scenes, Van Sant agreed it was an awful idea and dropped it. A similar idea, to have Will killed off at the end of the film, was also scrapped.
21. The actual end of the movie came from another Harvard alumnus and veteran filmmaker, Affleck family friend Terrence Malick. Initially, Will and Skylar were going to leave for California together, but after Damon and Affleck told Malick the movie's plot, Malick suggested that she should leave early on, and that Will should decide at the end to run off and find her.

22. The last line of the movie, when Sean reads Will's letter quoting his own remark and says, "Son of a bitch, he stole my line," was improvised by WIlliams.
23. The movie cost just $10 million to make. It earned back $138 million in North America and another $88 million overseas. It's the third-biggest domestic hit in Miramax history, surpassed only by "Scary Movie" and "Chicago." It's also far and away the biggest hit of Van Sant's career.

24. The Academy nominated "GWH" for nine Oscars, including Best Picture, Best Director, Best Actor (Damon), Best Supporting Actress (Driver), Best Editing, Best Original Score (Danny Elfman), and Best Original Song (Elliott Smith's "Miss Misery"). It famously won two trophies, for Damon and Affleck's original screenplay, and for Williams as Best Supporting Actor. "Ben's still the youngest writer to ever win an Oscar for screenwriting," Damon noted later. (Affleck was 25 at the time, and Damon was 27.) "I'd be the youngest if it weren't for Ben. F**king asshole."
25. It was during the Oscar campaign season that rumors began circulating that claimed Damon and Affleck didn't write the script. Damon blamed dirty-tricksters campaigning for rival films for the malicious whispers. Executive producer Su Armstrong said she was still dispelling the rumors 15 years later, insisting that she knew for certain that the Boston boys were the authors because she remembered the struggle to retrieve the file from Affleck's hard drive after his computer screen was shattered. "I can assure everybody that it was nowhere else but on Ben's computer," she said.

26. The movie's stars didn't know it, but they'd provided inspiration to another Ivy League student, Mindy Kaling. Like Affleck and Damon, she was from Cambridge. Her immigrant parents had picked her American name from Williams' old sitcom, "Mork & Mindy." At Dartmouth, Kaling befriended Brenda Withers, and together, they wrote an off-Broadway play called "Matt & Ben," which starred Withers as Damon and Kaling as Affleck. In their stage comedy, the script for "GWH" simply falls on them out of the sky. Damon's response to that premise was, "Office" and "Mindy Project" actress/writer's showbiz career.
27. After Williams' death in 2014, the now-famous bench in the Public Garden became a shrine, with Boston fans of the actor leaving flowers and writing their condolences in chalk on the surrounding paths.