“Once Upon a Time” wrapped up its fourth season on ABC Sunday night, revealing the backstory of the Author (Patrick Fischler) and transporting the characters of Storybrooke to a whole new world – “Heroes and Villains.” The episode made some big changes for the fifth season.

The “Once Upon a Time” Season 4 Finale kicked off with a flashback to our world in 1966. Before becoming “The Author,” Isaac was just a really bad TV salesman and aspiring writer. However, the Sorcerer’s Apprentice saw potential in Isaac and chose him to be the next Author after the previous one passed away. Although skeptical to begin with, Isaac ultimately accepted the “most important job in all the realms” and traveled into the other worlds.

In present day Storybrooke, Emma (Jennifer Morrison) and the others were trying their best to find a solution to the Author rewriting the storybook. August (Eion Bailey) arrived with some new information – that the Sorcerer’s Apprentice had the power to return the Author to the pages of the storybook. But unfortunately they had to get through another roadblock in order to get the Sorcerer’s Apprentice. He was previously locked inside the Sorcerer’s hat thanks to Rumplestiltskin (Robert Carlyle) and his control on Hook (Colin O’Donoghue). The Blue Fairy (Keegan Connor Tracy) was able to let the Author free. However they ran out of time. Isaac completed the new “Heroes and Villains” storybook for Rumplestiltskin, writing a happy ending for himself and the villain.

Upon writing the words “The End,” every storybook character was transported from Storybrooke to the new land – but Henry (Jared S. Gilmore) was left behind. Searching for his family, he stumbled across a paperback book of Isaac’s “Heroes and Villains.”

After writing the final words of the “Heroes and Villains” book, Isaac became a best selling author. He had many admirers for his take on the classic fairytale – but Henry wasn’t one of them. Henry found Isaac at a book signing and threatened to use the key to send him back into the pages of the storybook if he didn’t help him get his family back. However, Isaac told him it wasn’t as simple as that. He no longer held the power with the pen because he broke the rules and wrote his own happy ending. Needless to say, that wasn’t a good enough answer for Henry. He fought Isaac and stole the original copy of “Heroes and Villains.” Flipping open the book to a random picture, Henry stuck in the key and was transported into the pages of the story.

Henry entered the alternate reality – but he wasn’t alone. Isaac was transported as well and he wasn’t happy about it. If Henry changed anything, the whole story would crumble and Isaac’s happy ending would disappear. In order to stop Henry from making any of these changes, he knocked him out and tied him up. They were in the final chapter of the book, and time would run out when the bells rang.

Isaac’s plan was to let an ogre kill Henry ... but that didn’t pan out. At the last minute, Henry was rescued by the “Ogre Slayer” aka Knight Rumplestiltskin. Henry quickly moved forward and sought out Regina (Lana Parrilla). He explained the whole story to Regina and told her that everything would change if she kissed her one true love, Robin Hood (Sean Maguire). However Regina wasn’t buying his wild tale. She explained that Robin Hood was actually her competition and that she’d punch him in the nose if she ever met him. Tired of Henry’s story, she threw his paperback book of “Heroes and Villains” into the fire and went on her way.

Meanwhile, Isaac was navigating the woods and got caught in a trap. The Seven Dwarfs took Isaac to the Evil Queen – Snow White (Ginnifer Goodwin). She wanted to chop off his head, but he managed to change her mind by revealing a piece of her past that no one knew.

Isaac explained that he knew who she really loved – a man named James, the twin brother of Charming (Josh Dallas). Regina played a hand in his death, which is why Snow White became so bent on seeing Regina dead. With her one true love gone, she took Charming’s heart and forced him to be hers. Isaac continued that there was a boy named Henry who was helping Regina and that he knew where to find her.

Thanks to Isaac, Snow and Charming were waiting for Regina when she tried to rob their carriage. She almost crushed Regina’s heart, but stopped to question her about Henry. That stall in time allowed Robin Hood to swoop in and save Regina from her untimely death.

Regina immediately felt a connection with Robin Hood – but things were complicated. Robin Hood was set to marry Zelena (Rebecca Mader) later that day. Discouraged by this news, Regina left upset. That forced Henry to search for another way to change the ending of the story – Emma.

Heading to the docks, Henry found Hook (Colin O’Donoghue). The famous pirate wasn’t the captain that everyone knows him to be though. Instead, he was just a deckhand on Captain Blackbeard’s Jolly Roger. With no time to waste, Henry knocked out Blackbeard and commandeered the ship with Hook. The pair sailed to the island that Emma was kept locked up in and knocked out the black knight that guarded her door. When Henry went to free Emma, she knew exactly who he was.

When Isaac wrote “Heroes and Villains,” he had Snow White lock her in the tower. Emma knew the truth … but was powerless.

They quickly jumped back on the Jolly Roger to head back to shore to help Regina get her happy ending and change the story … but nothing is ever that easy. They narrowly avoided an attack from dragon Lily (Agnes Bruckner), and Snow and Charming were waiting for them at the docks. Hook bravely tried to hold off Snow and Charming, telling Emma to help Henry find Regina. But Hook was no match for Charming. He stabbed Hook in the chest and left him for dead.

Emma was devastated over the loss of Hook. It was necessary now more than ever to have Regina find her happy ending in order to change the story and bring Hook back to life. Fortunately, they managed to get Regina on board. The trio went to the church to stop Robin Hood from marrying Zelena … but Rumple was there waiting for them.

Isaac had visited Rumple and warned him that his happy ending was in jeopardy. Although Rumple was now a hero, he was willing to play the role of the villain in order to keep things from changing.

Emma made Regina run ahead to the church as she fought Rumple. But she was no match for him. He quickly knocked her out with the use of magic. It was up to Henry to step up to the plate to fight his grandfather. Rumple was about to kill him when Regina threw herself in front of the sword.

The bells started to ring, signifying that Emma and Henry had failed at changing the ending. However, Robin Hood found Regina on the ground at the same moment. Horrified to see her dying, Robin Hood promised not to let her die alone. That caused Zelena to have a mini-meltdown and yell about Regina ruining her day. Her outburst caused her to start turning green … but it still wasn’t enough to change the ending of the book. They needed Isaac to use his magic pen to rewrite the ending. But he insisted again that he no longer had the power. That’s when Henry picked up the magic pen. It immediately started to glow, signifying that he’s the next Author.

Using Regina’s blood, Henry was able to write that Isaac’s work was undone thanks to hero Regina’s sacrifice. The words immediately transported everyone back to Storybrooke – including Hook.

Emma was ecstatic to see Hook alive, but her second chance with him still couldn’t give her the courage to say the words “I love you.” Meanwhile, the Sorcerer’s Apprentice sat down with Henry to discuss his important new role. He once again explained that the role of the Author is to write the truth – not change reality. But Henry wasn’t thrilled to take over the position. He cracked the pen in half and told the Sorcerer’s Apprentice that no man should hold that much power. The Sorcerer’s Apprentice told Henry that it looked like they finally found the right person for the job.

It seemed like everyone was on track to get their happy ending in the Season 4 finale, but “Once Upon a Time” threw in one more twist. Back in the real world, Rumple was still dying. Although his body would be gone – the “Dark One” would remain.

The Sorcerer’s Apprentice tried to use the Sorcerer’s hat to place all of Rumple’s darkness. It appeared to be working at first … but quickly broke from all the darkness. The Dark One’s power escaped into the world and quickly plunged into the body of the Sorcerer’s Apprentice. Emma didn’t want anyone to have to be the Dark One, and used her magic to push it out again. However, it needed somewhere to go. The magic took to the streets and appeared to be all around them until it began to circle Regina. It wanted her light, but Emma wasn’t going to let her happiness get ripped from her again.

The Sorcerer’s Apprentice revealed that the Sorcerer had battled the darkness long before any of the stories began. It had terrorized the realm, so he tethered it to a human soul in order to control it with the dagger. Emma had to tether the darkness to a human soul … and knew that she was the only choice.

Before getting consumed by the darkness, she asked her parents to find a way as heroes to rid her of it. She then kissed Hook and finally said “I love you.”

The Season 4 finale of “Once Upon a Time” concluded with Emma turning into the Dark One and her name getting etched on the dagger. But there is hope for Season 5 – the heroes have to find Merlin, the only person who could end the darkness for good.