George Saundersisn’t usually the type of writer you’d imagine having written the inspiration from aChris HemsworthandMiles Teller-starring Netflix film fromJoseph Kosinki, the director of this summer’sTop Gun: Maverick. Saunders is known for his surprising, often absurd short stories, and his Man Booker Prize-winning book,Lincoln in the Bardo—a novel primarily spent in the place between life and rebirth and centered onAbraham Lincoln’s son, who died at the age of 11. Not exactly the creative mind you’d expect behind a film of this scale.

Saunders’ short story, “Escape From Spiderhead” was a farcical, oddly horny, and unusual-yet-believable tale about prisoners who choose to be test subjects for experimental drugs, instead of going to a regular prison. It’s a concept that is full of cinematic possibilities, and yet, the beauty of the film adaptation,Spiderhead, is that Kosinski and writersRhett ReeseandPaul Wernick(Zombieland,6 Underground) embrace the weirdness of Saunders’ story, largely sticking to the source material to create one of the strangest, bizarre and most enjoyable films of the summer.

One of the prisoners at the Spiderhead research facility is Jeff (Teller), who usually goes with the flow, follows the rules, and tends to accept the requests of Spiderhead’s overseer, Steve Abnesti (Hemsworth). Jeff is tasked with trying out all sorts of new drugs that alter his consciousness, whether they’re drugs that make him uncontrollably laugh, or make everything around him more beautiful. But Jeff starts to question his assignments when he’s tasked with deciding which prisoner gets a dose of Darkenfloxx, a drug that makes the user extremely sick, to the point that they almost immediately want to kill themselves. As Jeff is asked to start harming others with this drug, including Rachel (Jurnee Smollett), a fellow inmate he’s started to fall for, he begins to question his obedience at this unorthodox facility.

RELATED:Chris Hemsworth Is an Evil (and Sexy) Scientist in New ‘Spiderhead’ Clip

While this all sounds like the setup for a big action film, Kosinski keeps this story surprisingly insular and small, rarely ever leaving the walls of the Spiderhead base. Like these prisoners, we are mostly confined to these walls, with the only occasional glimpse of the world outside. But this scale is exactly whatSpiderheadneeds, allowing for this story to indulge in the inherent peculiarity of this concept, without the danger of ever getting too vast for this story’s good.

Kosinski makes his audience want to explore every nook and cranny of this hybrid prison, especially when it is full with such a wild and intriguing cast. Teller plays Jeff at just the right tone, wanting to appease his prisoners and atone for his past, but also shows the fear and uncertainty of this situation when it starts to get out of hand. The same is true of Rachel, who has a more unknown past, but opens up—with plenty of caution—around Jeff.

But the key to what makesSpiderheadso entertaining is a great mixture of danger and preposterousness—which is best shown through the fantastic performance of Hemsworth. In fact, Hemsworth has never been better as Steve Abnesti, a yacht rock-loving scientist who jokes with his prisoners and co-worker Verlaine (Mark Paguio), but can flip at a second’s notice to something sinister and unpredictable. Hemsworth is having a ball here, dancing around to Roxy Music while getting high on quite literally his own supply. At times, Hemsworth’s performance almost reminds ofOscar Isaac’s similarly dubious genius inEx Machina.

It’s that blend of danger and the ridiculous that permeates all ofSpiderhead. For example, one of the film’s mysteries is who is smearing fecal matter on the walls of the compound—a person who has appropriately been named “Shitfinger”—and the film’s biggest action sequence is scored by a music player on the fritz, jumping between songs by Poco and Hall & Oates. Little touches like this expand the Saunders short story, but maintain the overall spirit of the source material.

Naturally then, it’s when the film diverts away from that tone whereSpiderheadcan at times swerve from the original story’s intention in ways that don’t always work. WhenSpiderheadexplores the past of Jeff and the incident that brought him to the prison, the film often gets melodramatic in a way that doesn’t match the tone of the story. And while the experimentations ofSpiderheadcan certainly get a bit over-the-top and silly at times, those moments still fit in with the insanity flowing through this story.

YetSpiderheadmostly sticks to that absurd tone and delightfully fun aesthetic, while also exploring a story about the prison system, self-forgiveness, and the difficult decision to do what’s right as opposed to what is easy. Kosinski has already made one of the best year’s best movies withMaverick, and with an extremely intriguing concept and fantastic performances all around the board, Kosinski has for the second time this year made one of the best movies of this summer.

Spiderheadcomes to Netflix on June 17.