The current consensus on Anne With an E, the new CBC adaptation of Anne of Green Gables debuting Friday on Netflix, is that it’s a darker interpretation of Lucy Maud Montgomery’s beloved 1908 novel. Certainly, the first two episodes, which explore how the 13-year-old Anne Shirley is adopted by Matthew and Marilla Cuthbert, deviate from the book in offering dramatic and painful flashbacks to Anne’s life before the Cuthberts took her in. When Anne first arrives at Green Gables—set in the fictional town of Avonlea on Prince Edward Island—she’s as garrulous and joyously imaginative as ever, but it’s also clear that her experiences as an orphan have left her deeply traumatized.

Returning to the book after a few decades’ absence, though, I was surprised at the bleakness of Montgomery’s early chapters. When Matthew is astonished to find that Anne’s a girl instead of the boy he requested, a station-master quips, “Maybe they were out of boys of the brand that you wanted,” as if Matthew were shopping for toilet paper at Target rather than rescuing a child. After Anne learns that she might not be being adopted after all, Montgomery describes how, “upstairs in the east gable, a lonely, heart-hungry, friendless child cried herself to sleep.” And Anne, who could talk an inanimate object into madness, becomes suddenly quiet when Marilla asks to hear her history. “Evidently,” Montgomery writes, “she did not like talking about her experiences in a world that had not wanted her.”

So Anne With an E, created by Moira Walley-Beckett, a longtime writer and producer on Breaking Bad, isn’t exactly inventing darkness for the story so much as reading between the lines. It’s Anne of Green Gables for 21st-century audiences, who are perhaps more sympathetic to the idea that children can suffer. That’s not to say darkness defines the show. Anne With an E captures the winning exuberance of Anne Shirley—who, played by AmyBeth McNulty, is entirely irresistible—while finding some deeper potency in her story. The first two episodes offer a gripping and moving setup for the rest of the season, portraying how Anne, despite improbable odds, persuades the elderly Cuthberts to love her.

The first 90-minute installment is directed by Niki Caro, whose 2002 film Whale Rider about a Maori girl intent on becoming the leader of her tribe was an unexpected hit. Caro captures the dreamy quality of Avonlea as Anne first encounters it, with its wild coastal landscape and abundant blossoms. Anne is as immediately taken with it as the reticent Matthew (R.H. Thomson) is with the vibrant girl who talks his ear off on the ride to Green Gables. It’s down to Marilla (the estimable British actress Geraldine James) to break the bad news that Anne is an error, and McNulty’s face crumples as Anne realizes she hasn’t found a home just yet.

The show hints that Anne might be suffering from PTSD—she has flashbacks where she lapses into fugue states, remembering past scenes of cruelty and a vicious beating. And the tension in the first two episodes is almost unbearable, as Marilla tries to decide whether she can feasibly keep a girl instead of the boy the farm requires. But McNulty makes Anne an instantly captivating character: She’s intelligent, fearless, and performative in her enthusiasm without being obnoxious. It’s impossible not to root for her. James is impeccably cast as Marilla, conveying the character’s frostiness, but also her underlying kindness and sense of humor. As the taciturn Matthew, Thomson does a lot with very little, conveying a real and unexpected attachment to the new arrival.

Walley-Beckett has paid precise attention to detail in creating Avonlea, reportedly down to the kinds of potatoes the Cuthberts might have for dinner. The 1985 CBC miniseries Anne of Green Gables might have plenty of committed devotees, but it’s hard to quibble with the beauty and polish of Anne With an E, with its sweeping vistas and Dickensian street scenes. Its visuals conjure the landscape Montgomery wrote so lovingly, with wild cherry trees in bloom, and “fringing groves of fir and maple and lay all darkly translucent in their wavering shadows.”

The challenge for adaptations of canonical books is expanding the story to fill eight or ten or thirteen hours of television while staying true to the essence of the plot and the characters. But as Hulu’s new adaptation of The Handmaid’s Tale is also demonstrating, there’s real opportunity in being able to flesh out intriguing characters and their histories. The rest of Anne With an E will reportedly branch out from the book by exploring how Matthew and Marilla ended up unmarried and living together at Green Gables, while continuing to add depth to Anne’s biography. It’s the kind of approach that, done well, shows how rewarding and imaginative series based on books can be. As Anne might say, there’s just so much scope for the imagination.