Malcolm (Shameik Moore), Jib (Tony Revolori) and Diggy (Kiersey Clemons) are geeks. They, as established by the Forest Whitaker-supplied voice over at the onset of Rick Famuyiwa’s new film Dope, are big fans of “white sh*t” like manga, getting good grades and Donald Glover. They revel in the culture of 90’s hip hop, obsessively poring over VHS tapes of Yo! MTV Raps and styling their hair and outfits on those distinctively pastel fashions of the era. They also live in Inglewood, California in the middle of an inordinately perilous place for young teens with ambition. Their daily bike rides home consist of last minute alternate routes to avoid confrontations with Crips, Bloods and drug dealers so they can get home, watch some TV and jam out in their band, Awreeoh. For the three geeks at the center of Dope, their world is a speed bump on the road to the rest of their lives.

Of course, when taken at the wrong velocity, a speed bump can crack an engine block and completely derail one’s trip. Such is the potential fate for Malcolm, who becomes entangled in the life of a local drug dealer named Dom (A$ap Rocky), first as the intermediary between him and his girlfriend Nakia (Zoe Kravitz, in full Lisa Bonet mode) who Malcolm happens to have a crush on. When Malcolm and his friends decide to attend Dom’s birthday party at the behest of Nakia, the cops raid the place and Malcolm comes to school the next morning to find his backpack full of a staggering amount of ecstasy and a loaded gun. Luckily, everyone at the school knows he’s a geek, allowing him to skirt by the metal detectors and drug sniffing dogs with no suspicion. Unluckily, Dom is in prison and his supplier would much rather receive money for his drugs than the return of them, forcing Malcolm and his friends into the untenable position of becoming overnight drug dealers. Of course, this is also happening in the middle of college interview season, and Malcolm’s ability to become a Harvard man is dependent on nailing the interview with a local business owner. What could possibly go wrong?

For those of a certain filmic persuasion, Dope’s tale of outcast high school students falling face first into a drug deal gone bad might evoke Rian Johnson’s breakthrough debut Brick, and there are certainly quite a few similarities. Of course, Famuyiwa’s film is much more of a farce than the hard boiled, Dashiell Hammett soaked Brick, but both manage to succeed as refreshing new angles on the sorts of films that have been made for years. This is more of a case of throwing some nerds in the middle of a John Singleton movie and seeing what happens, giving Famuyiwa the opportunity to make some keen insights into how societal understanding of places like Inglewood and general perceptions of the thug/gang banger culture can have negative implications on those caught up in its wake. Dope is very much a film about those preconceived notions and how they color these people’s world (and indeed, no one is safe, as Malcolm and crew’s first notion for who to sell the ecstasy to is “white people at Coachella,” not to mention their stoner mentor as played by Blake Anderson from Workaholics), but it never forgets that it is a comedy first and foremost, and uses that comedic charm to its advantage thematically as well.

The film is also refreshingly modern, arguably the first drug movie that truly exists in the digital age. Bitcoins play a pivotal role in the plot, as well as memes and illicit Silk Road-esque sites on the dark web. It all grows organically out of the plot and the characters as defined; none of it feels out of place or tacked on. What can feel a little tacked on, though, is the manner in which the film has a tendency to operate on coincidence, especially during the second act. There is a series of plot moments that seem to be implausibly intertwined, almost like something out of Magnolia or a Robert Altman movie, and while Famuyiwa shows a flair in this film, he is not exactly on the same terms as his forbears in that case. Famuyiwa also slips up a bit with the film’s ending, framed by Malcolm’s college essay (yes, just like Risky Business and The Spectacular Now, among others, though the essay is more foundational to the plot here). The final essay has a strong message, but it feels tonally adrift from what it around it, overreaching slightly into something that does not quite work. The heart is there, but the brain lets him down.

Luckily, the weaknesses of Dope do not tip the scales away from its otherwise overflowing sense of exuberance. Awreeho’s songs are infectious (as they should be, considering they were written by hitmaker extraordinaire/hat enthusiast Pharrell Williams, who executive produced), and the chemistry of its three leads remains eminently charming. While Revolori may be the only one of the three with any previous recognition thanks to his role in The Grand Budapest Hotel, the future seems very bright indeed for all three of these young thespians, with Moore providing an especially magnetic performance. Slight misgivings of plot and tone notwithstanding, Dope is excellent counter-programming for those that looking for an escape from the dinosaurs and Avengers and Ant-Men of the summer.