The Black Fairy’s curse takes over on the season finale of Once Upon a Time.

This episode closed the book on many of our favorite characters while starting a new one for others. At the start of the hour, we get our first glimpse at that new book, as we flash to a time of great upheaval in the Enchanted Forest. There, a man tasks his young daughter with keeping a book of stories safe. Some time later, the girl fears her father has died, but Tiger Lily assures her that she will see him again. They then set off to bring the book to the girl’s mother.

In present-day Storybrooke, Henry wakes up with only Emma, Archie, Rumple, Gideon, and the Black Fairy there, all of whom think he’s crazy for believing in fairy tale nonsense. Emma’s even in a mental hospital for once believing his delusions, and, instead of Regina, Fiona is Henry’s adoptive mother and Mayor of Storybrooke. Fiona works hard to convince Emma to burn Henry’s storybook, eventually getting her to do so by pushing Henry down the stairs and making her believe it was his unbridled hope that caused it.

After burning the book, Emma hightails it back to Boston—the pilot references abound—but finds a hand-drawn storybook that Henry made for her. She comes back just in time to get her memories back and begin the Final Battle with Gideon. This is thanks to Gold, who was actually awake the whole time and, after some encouragement from Henry to do the right thing, as well as being separated by Belle, decides to kill the Black Fairy. Fiona’s defeat also brings the rest of the gang back to Storybrooke, who arguably had a worse time of it than the others.

After the curse, Regina, Snow, Charming, and Hook all wake in the Enchanted Forest, with their memories, but sans anyway to get back to Henry and Emma. They’re eventually joined by Zelena and the Evil Queen, both of whom team up with Regina to try to get them back home but face an uphill battle. You see, as Emma’s belief wavers back in the Storybrooke, the realms begin to vanish and the magic from those realms disappears as well. Hook and Charming even make a play for a magic bean, retrieve it, and then watch as it shrivels before their eyes.

As Emma leaves Storybrooke for Boston and her belief is at its lowest, the Enchanted Forest begins to crumble as well, with the Evil Queen making the ultimate sacrifice: guarding the castle against the magic trying to take it away, as the others run to safety. After Rumple kills his mother, the other heroes reunite with Emma and Henry on the street in Storybrooke. The happy times, however, are short-lived, as Gideon, whose heart remains controlled by Fiona even after her death, approaches. Rumple finds his son’s heart and tries to control it himself, to no avail.

Instead, Emma decides that the only way to win is to fight light with more light, dropping her sword and winning the battle for both herself and Gideon. Afterward, the heroes look around them, unsure what to do next, but Snow, beaming, tells them that now that the story is over, they just get to live. And live they do, as we’re treated to a pretty perfect montage of Snow and Charming on a farm, Emma and Hook working as co-sheriffs, Henry going off to school with Violet, Regina happily returning to her Mayoral duties, and everyone gathering for a meal at Granny’s. Rumple and Belle, though, get the best surprise of all: Gideon’s return to infant form, thus giving them a chance at a new life for both their son and their family. And, back in the Enchanted Forest, the realms are restored, with Robin even proposing to the Evil Queen via arrow.

Of course, it wouldn’t be Once Upon a Time without a teaser of what’s to come, so we flash forward “Many Years Later” to the girl from the beginning of the episode, this time in the real world and headed to Seattle, new storybook in hand. She knocks on her father’s door, who is, of course, our own Henry, all grown up and with no idea that the kid in front of him is his.