Just when there doesn’t seem to be anything new and worthwhile in multiplexes, an unexpected surprise is there to greet me. I love these moments.

Dope comes to us from writer/director/exec producer Rick Famuyiwa, previously responsible for such time-honored classics as Brown Sugar and Our Family Wedding. The cast is loaded with no-name actors, save only for A$AP Rocky (a rapper best known as Iggy Azalea’s ex-boyfriend), Zoe Kravitz (who’s bound to break out any day now, the way her career’s been going), and Forrest Whitaker himself as the narrator. Whitaker also produces the film, alongside exec producers Pharrell Williams and Sean “Don’t call me Puff Daddy” Combs.

Such a bizarre collection of talents somehow got together to make a film. And that film was somehow good enough to merit a 90 percent Tomatometer, racking up nonstop critical acclaim ever since bowing at Sundance and Cannes this year. How could I resist the chance to give it a look?

This is the story of a high school senior named Malcolm Adekanbi, played by newcomer Shameik Moore. He’s spent his whole life in “The Bottoms,” an especially poverty-stricken and gang-ridden stretch of Los Angeles, raised by his single mother (Kimberly Elise). His dad, by the way, moved back to Nigeria before Malcolm was born, so the two have never met.

Malcolm’s best friends are Jib (Tony Revolori, of The Grand Budapest Hotel fame), a multi-ethnic dork in a prominently black neighborhood; and Diggy (Kiersey Clemons, making her film debut), a teenage lesbian whose family tries on a weekly basis to “pray her gay away.” As if to add to their misfit status, the three of them play together in a crappy punk band called “Awreeoh” (whose songs all came courtesy of Pharrell, by the way). Even better, the three of them are obsessed with ’90s nostalgia, particularly with regard to period fashion, old-school rap, and programming from back when MTV at least pretended to be about music. It stems from the idea that these kids were born out of their time, and they all wish they had grown up in the golden years of the ’90s.

Of course, anyone who grew up at the time will remember how everyone felt that way about the ’80s back then. God, I feel old.

Anyway, Malcolm is the rare straight-A student in The Bottoms. He’s trying to keep his head down and do the work just long enough to get out of The Bottoms and go to Harvard. Why Harvard? Well, that’s for a lot of reasons. For one thing, he doesn’t want to try and sell himself short. Shoot for the moon, and even if you miss… well, you know the rest. For another thing, Malcolm doesn’t want to be a drug dealer or a gangbanger like everyone else in his neighborhood. He wants to be something better than that.

There’s a third reason, but it’s part of an epic mic drop near the end of the film that I don’t dare spoil here.

Anyway, we catch up with Malcolm just before the SAT, when he’s putting together his application for Harvard. And the guy’s written a deconstruction of Ice Cube’s “Today Was a Good Day” for his application essay. That may sound ridiculous, but Malcolm’s logic goes that it shows his skills at thinking critically and presenting a thesis in a creative way. It has a chance at standing out, as opposed to some boilerplate personal essay about how he’s a poor kid raised in the slums by a single mother, et cetera, et cetera.

Of course, Malcolm’s teacher responds by outright rejecting the essay. “Who do you think you are?” he asks. “You think your straight As mean anything?” At first, it’s easy to misinterpret the statement, saying that Malcolm doesn’t stand a chance of going anywhere because of his background. But with hindsight, it’s really more about Malcolm asserting himself. We don’t live in a perfect world where everyone gets what they deserve just because they’ve done the work. Malcolm may have outstanding grades, but so do the hundreds of other students applying to Harvard, and they’re not all going to make it. A bit of aggression is necessary, but the trick is knowing how much is too much. And Malcolm gets to learn that lesson the hard way.

Our boy eventually crosses paths with Dom (A$AP Rocky), a known drug dealer who takes a sudden and inexplicable shine to Malcolm and his adorable ’90s nerdiness. It appears that Dom is trying to patch things up with Nakia (Zoe Kravitz), so Malcolm is recruited to act as a messenger between them. Nakia eventually agrees to attend a birthday party Dom is throwing, but only if Malcolm comes along. That Malcolm and his friends are underage is of course beside the point.

Now, think about what we’ve got here. On the one hand is Malcolm, associating with a known gangster and entering a bar without a valid ID when even the slightest criminal history would permanently destroy his dreams of Harvard. On the other hand is Dom, who may be the sort of charitable yet aggressive mentor that Malcolm needs. But Dom is clearly a very dangerous individual with no fear of violence, so there’s every possibility that Dom may — intentionally or otherwise — come back to bite Malcolm in some way. There’s also the matter of Nakia, who may or may not be a more suitable love interest for Malcolm. Which leaves Malcolm trying to untangle the relationship between Nakia and Dom without pissing off either one.

This is a fascinating dynamic that could easily power an entire movie. And then the dynamic changes after the first act, kicking the movie into a higher gear.

It seems that Dom was just getting started on a massive drug sale when things go sideways and there’s a police raid at the party. People get shot and Dom gets arrested, but Malcolm and Nakia get away safely. Until Malcolm figures out that Dom hid his shipment in Malcolm’s backpack, with a gun and a cell phone for good measure.

So Malcolm is in over his head, caught between forces he doesn’t understand or want anything to do with. The whole second act is pretty much an extended chase sequence, until Malcolm and his friends get a bit of breathing room to figure out how they can turn this thing to their advantage. And while all this is happening, Malcolm is left with the implicit question of whether he’s only doing what he needs to survive, or whether he’s becoming the kind of drug-dealing trash he swore he’d never be.

It should be obvious by now that a lot of this movie is centered on issues of poverty and race. Those are some tough matters to grapple with, but here’s the kicker: This is a coming-of-age film. It’s about a young man trying to find his place in the world. In this more specific case, it’s about a young black man from the slums trying to find his place in the world. Every last thing about this story — especially the themes of race and social standing — all come back to that. Which means that as Malcolm gradually starts to make his peace with where he came from, where he needs to go, and what he has to do to get there, we can look at such important social issues through an empowering and uplifting perspective.

More importantly, the film is good enough to use humor as a means of sugaring the pill. A fine example comes about halfway through the film or so, when we’re treated to lengthy discussions about certain double-standards when it comes to a certain N-word. Relatively light, and it’s tough to deny that the talks grind the film to a halt, but it’s still a discussion worth having.

Also, when you get right down to it, the whole film is all about a “straight man” who finds himself in an outrageous scenario. That’s a classic setup for comedy, and it’s used extensively in this picture.

Far more frequently, however, the film will use humor that’s more manic. The film seems to have a kind of self-aware nature, particularly in how editing tricks and pop-up graphics are used in flashy ways to elaborate on certain story points. It isn’t nearly as meta or off-the-wall as in Detention, for instance, but it’s in the same class. It’s clear that the film doesn’t take itself too seriously, which allows for a certain amount of levity with regards to bigger issues and more dangerous action scenes. Not too much that we lose sight of how important these moments and messages are, but just enough that we don’t lose sight of how this is supposed to be a fun and uplifting coming-of-age story.

It’s this tongue-in-cheek sort of charm that allows the film to get away with several glaring flaws. There are way too many contrived moments and coincidences, especially for such a huge city as LA. We’ve also got a lot of characters who seem to be treated more as plot devices than actual people. Yet none of that seems to matter, because it all results in some great humor, and also because this movie clearly operates on its own batshit terms.

The film also gets away with some cliched moments and characters by virtue of the themes at play. Our protagonist doesn’t feel comfortable dealing with other people, and he’s the frequent target of paper-thin bullies. In any other movie about a high-schooler, this would be boring. But with the gang factor, it takes on a whole ‘nother dimension. Of course Malcolm doesn’t feel comfortable talking with other people, because there’s every possibility that somebody could try and mug him or worse. As for the bullies, well, they’re Bloods. So they roam in packs, acting like they own the place, pushing people around as a show of force, because that’s exactly what you’d expect gangbangers to do.

Another big problem is in Forest Whitaker’s narration. He opens the movie with A LOT of expository voice-over, all dispensing with stuff that should have and probably could have been told in the movie proper. But again, it’s funny. Plus, it does so much to establish the setting and Malcolm’s mindset, introducing some very important statements along the way that might otherwise not have occurred to the audience (the line about how every decision in The Bottoms is between bad and worse is especially crucial). Perhaps most importantly, the opening voice-over sets the tone for the rest of the movie right off the bat. The moment we hear some unnamed narrator talking to us, it sends a message that we shouldn’t expect to take the film too seriously, and things are going to get self-aware in a silly manner.

Last but not least, there’s the problem that every single act seems to be its own movie. Just when it seems like the story has settled into a groove, something sudden and drastic happens to take the narrative in a completely different direction. This might have made for a wonky and disjointed film, yet it all stays cohesive. And the credit for that is due entirely to Shameik Moore. His performance is endlessly compelling from start to finish. Moore does such a fantastic job of showing how Malcolm learns and grows that the character’s development becomes the glue holding this entire fragmented movie together.

Dope has a lot of storytelling problems, but the film more than makes up for that with heart, intelligence, energy, humor, and creativity. This is a movie that knows when to make fun of itself — to gloss over certain character and plot deficiencies — and when to take itself seriously — to focus on the protagonist’s development and make a greater point. There are a lot of poignant and incisive statements to be found here, wrapped up in so much ’90s nostalgia and manic humor.

I had a great time with this movie, flaws and all. Definitely recommended.

For more Movie Curiosities, check out my blog. I’m also on Facebook and Twitter.