Before Steven Spielberg became Hollywood royalty, he was just another young director with a giant shark problem.

It was July 1974, and 27-year-old Steven Spielberg was sure his career was over. He’d been on location in Martha’s Vineyard for three months, waiting for the overdue star of his new movie Jaws. And now, as he watched the first lunges of the $250,000 mechanical shark in action, Spielberg’s heart sank. The beast was anything but menacing. His eyes crossed. His teeth were too white. His jaws didn’t close properly. And he had a big dimple that made him look like Kirk Douglas.

The shark was just the latest of Spielberg’s setbacks.

Before Jaws, movies weren't shot on the ocean. Hollywood studios simply tossed a boat in a tank and projected moving scenery behind it. But Spielberg wanted realism. And he paid for it. Boating mishaps and near drownings had almost killed several cast and crew members.

Rough waters and drifting tides made for chaotic filming. Most days, once the crew had anchored the 12 tons of rigging into place and waited out unwanted boats on the horizon, Spielberg was left with just two hours of afternoon light to shoot. As Spielberg burned through his $4 million budget and 55-day shooting schedule, the cast and crew turned mutinous. Angry locals left dead sharks on the production office’s porch. Studio execs worried the film wouldn’t deliver. And Spielberg lived in constant fear of having the plug pulled. Word in Hollywood was that the young director was finished. But Spielberg, who felt “like Captain Bligh” on a sinking ship, was determined to complete his movie, shark or no shark.

A Picture Book of Fears

When a Long Island fisherman caught a 4,500-pound great white in 1964, author Peter Benchley took notice. “What would happen if one of those things came around and wouldn’t go away?” he asked. Ten years later he turned the idea into the bestselling novel Jaws. Benchley’s book sparked an immediate bidding war in Hollywood, with Universal coming out on top—all before it even hit shelves.

Spielberg wasn’t the studio’s first choice as director. Universal initially approached Dick Richards, but when Richards kept referring to the story’s predator as a "whale,” the producers lost patience. Enter the young and ambitious Steven Spielberg. His résumé included more TV movies and episodes of Columbo than feature films. And his one stab at the big screen, The Sugarland Express, had drawn critical raves but tanked at the box office. Still, the suits were impressed by his confidence. Spielberg’s vision for Jaws was part high adventure, part horror: “a picture book of fears, phobias and anxieties.”

Spielberg had his own doubts about the project. As a new director, he had art-house aspirations and dreamed of making critically acclaimed films. But he knew that one more flop would torpedo his career. He had to make Jaws a blockbuster.

To do that, he needed a truly terrifying shark. Producers wanted Spielberg to hire someone to train a great white—an impossibility. The director toyed with rubber props before ultimately deciding the only real answer was to build a remote-controlled mega-shark—a 25-footer that could swim, leap in the air, and munch on human prey. Every special effects company in Hollywood called the task impossible. Undeterred, Spielberg lured effects guru Bob Mattey out of retirement. Famous for designing the giant squid in the 1954 film 20,000 Leagues Under the Sea, Mattey assured the director he could build the perfect monster.

With three sharks in production (collectively nicknamed Bruce, after Spielberg’s lawyer), Spielberg focused on the screenplay, which had gone through four writers and five drafts. The script was still unfinished as shooting began, so Spielberg hired his friend Carl Gottlieb to do the final polishing on set. Though it made the studio nervous to use a sitcom writer whose credits included The Odd Couple and All in the Family, Gottlieb proved to be one of the movie’s secret weapons.

Each night he sat with stars Roy Scheider, Richard Dreyfuss, and Robert Shaw, taking notes as they improvised unfinished scenes. In Gottlieb’s hands, a straight monster flick became a character-driven film. And many of the flick’s most memorable lines—including “You’re gonna need a bigger boat”—came out of his process.

During the first three months of production, Spielberg focused on bringing fictional Amity Island to life. Whether orchestrating hundreds of extras through a beach panic scene or refereeing an off-screen battle of egos between Shaw and Dreyfuss, the director remained calm and confident. But as he prepared to take his cameras onto the high seas, one question remained: Where was the shark?

What Would Hitchcock Do?

When Mattey finally delivered Bruce, Spielberg began to panic. On its first day on the job, the shark promptly sank to the bottom of Nantucket Sound. Within a week, saltwater had eroded Bruce’s electric motor, and he had to be refitted with a system of pneumatic hoses. Every night, Bruce also had to be drained, scrubbed, and repainted. Even by diva standards, Bruce was high-maintenance.

“I had no choice but to figure out how to tell the story without the shark,” Spielberg said. “So I just went back to Alfred Hitchcock: ‘What would Hitchcock do in a situation like this?’ ... It’s what we don’t see which is truly frightening.”

The idea of the unseen enemy completely changed the film’s direction. It shapes the opening scene where a girl goes for a midnight swim and becomes the shark’s first victim. We see her legs underwater. We hear the ominous notes of John Williams’s score. And then we watch as she’s yanked down and dragged violently through the sea. The crew achieved this terrifying effect by tying ropes around actress Susan Backlinie, then playing a game of aquatic tug-of-war.

The sidelined shark also prompted Spielberg’s creative use of the ocean itself. He wanted the water lapping at the lens to make the audience feel like they were not only “in the ocean, but about to drown.” Cameraman Bill Butler invented a “water box” with glass windows that allowed cameras to be submerged. Gottlieb deepened the constant state of anxiety by stirring humor into the horror. Almost every appearance of the shark comes directly on the heels of a joke—the careful orchestration of screams, laughs, and foreboding silence keeps the audience emotionally off balance.

An exhausted Spielberg finally returned to Hollywood 159 days and nearly $8 million later. But his work wasn’t over. With the help of veteran editor Verna “Mother Cutter” Fields, he pieced the movie together. The New England weather haunted him—the wildly varying light and changing skies made for endless headaches as they matched footage. Massive reels of Bruce had to be cobbled into cohesive bursts of terror. To add an extra scare, Spielberg reshot part of one scene in Fields’s backyard pool, dumping powdered milk in the water to approximate the murky ocean. But even after finalizing the film, Spielberg doubted the results. Would his shark movie scare audiences, or would it be the “laugh riot of ’75”?

Legacy

Spielberg didn’t know it, but his malfunctioning sharks were about to radically alter Hollywood’s business model. All the shooting delays meant that Jaws couldn’t hit its planned release date, right in the heart of 1974’s lucrative Christmas season. Instead, Universal made the gutsy call to hold the film until summer, a season that had traditionally been the dumping ground for cinematic afterthoughts.

Then something unbelievable happened. Test screenings that spring drew such positive reactions that MCA/Universal’s stock price shot up by several points. Certain that it had a hit, Universal seized the momentum with a marketing blitz. Studios had always shied away from using expensive television spots to market films, but Universal dropped an unheard-of $700,000 to saturate prime-time programming with 30-second trailers.

The opening strategy was equally aggressive. Traditionally, high-profile movies opened in New York City or Los Angeles before slowly spreading to other cities and then trickling into small towns months later. Wide releases were generally reserved for duds; studios would cast a wide net to maximize ticket sales before negative word of mouth killed a film. But after the ad campaign made Jaws the summer’s can’t-miss flick, Universal went all-in on the release, and the movie opened in an unprecedented 465 theaters on June 20, 1975.

The gambles paid off—Jaws grossed $60 million in its first month. It went on to become the first film to top $100 million, eventually hauling in an astonishing $260 million. Critics were just as enthusiastic. The New Yorker’s Pauline Kael dubbed it “the most cheerfully perverse scare movie ever made.” The film was nominated for the Academy Award for Best Picture, and it won three other Oscars.

Spielberg would later say, “Jaws should never have been made—it was an impossible effort.” Yet all those frustrating days at sea and short-circuiting sharks got the young director exactly what he had always wanted. By creating the prototype for every summer blockbuster that followed, Spielberg earned the freedom to make artier films like The Color Purple and Schindler’s List. He went into his next project, Close Encounters of the Third Kind, armed with a bigger budget, more creative control, and the knowledge that sometimes the biggest obstacles were actually his biggest assets.

This article originally appeared in mental_floss magazine.