James McAvoy in Split.

The key to M. Night Shyamalan’s recent success seems to be a limit on the amount of money he’s allowed to throw around.

After working with sizable budgets on big projects like The Last Airbender, After Earth, The Happening, Lady in the Water and The Village—all of which sucked major ass—Shyamalan almost made a good movie for $5 million with The Visit.

Now he’s finally made his first good movie since Signs back in 2002 with Split, a down-to-the-basics, creepy thriller propelled by excellent performances from James McAvoy and Anya Taylor-Joy. The film—with a $10 million budget, according to IMDb—reminds us that Shyamalan can be quite the capable director (and writer) when he isn’t getting too carried away.

Taylor-Joy, so good in recent horror masterpiece The Witch, plays Casey, an introverted, outcast high school student attending a birthday party for Claire (Haley Lu Richardson) simply because she got a “mercy invite.” Casey’s stuck after the party, so Claire’s dad offers her and another friend, Marcia (Jessica Sula), a ride home. That ride never gets out of the parking lot, because a strange, angry man (McAvoy) winds up in the driver’s seat and sprays the girls with a chemical. They wake up together in a prison cell.

McAvoy’s character, as you know from all the trailers and previews, is suffering from a form of split-personality disorder. In addition to the man who kidnaps them, he’s a stately, mannered woman; a 9-year-old child; and several others. One of those others plays a big part in making this film more than just a psychological thriller.

McAvoy is bone-chillingly good here, seamlessly segueing into each personality, and giving each one an original vocal and physical spin. In ways, this plays out like a modern-day Psycho, with a few more personalities thrown in, and without the shower scene.

While in the Hedwig persona, McAvoy has a memorable dance scene—a welcome funny break in the movie. McAvoy even saves what could have been a hokey finale by delivering his final major monologue with such ferocity that we buy into it. McAvoy’s great work here has a place alongside Anthony Perkins in Psycho, Jack Nicholson in The Shining and Kathy Bates in Misery.

The last act of the movie, when Shyamalan takes things into strange monster-movie territory, is truly scary. I won’t give away any secrets; go see the movie, and have some fun with it. Well, “fun” might not be the right word. It’s pretty freaking bleak.

Taylor-Joy is becoming a new kind of “scream queen.” She has an amazing array of expressions, and Shyamalan takes advantage of this. Rather than shrieking her face off as the terrorized often do in horror movies, Taylor-Joy is a restrained, conflicted kind of horrified. What she lacks in volume, she makes up for in major intensity.

Following up her terrific performance in The Edge of Seventeen, Richardson takes the normally vain “popular” character in horror films and gives her a lot of depth and smarts. Betty Buckley does well as a therapist (basically this film’s Dr. Loomis, although less crazed) trying to help the McAvoy characters handle their afflictions. Shyamalan himself shows up for a fun cameo, and stick around for the credits, which include a powerful Easter egg.

Given his current trajectory, Shyamalan could be one or two films away from giving us another masterpiece. Split is one of his best, and proof that we weren’t all crazy back when we figured he would do great things behind a camera.

Split is playing at theaters across the valley.