Like all books, a good fantasy needs a solid plot, three-dimensional characters, and enough emotion to make the reader care. But a great fantasy also needs a clever magic system to distinguish it from its peers. Here are five of the niftiest, most memorable fantasy elements I’ve read in recent years.

The spell with a mind of its own (The Color of Magic by Terry Pratchett)

In this witty fantasy, misbehaving wizard Rincewind opened the world’s most powerful spellbook on a dare. One of the spells made its way into his head, where it has been hiding out ever since—taking up so much space in his memory that he can’t learn any other spells. This spell has an agenda, and it will eventually say itself when the time is right. Until then, it will move heaven and earth (literally) to keep Rincewind, and itself, alive.

The castle with a mind of its own (Tuesdays at the Castle by Jessica Day George)

In this charming children’s book, the castle where the main character lives can change at will, locking doors, bending hallways, and making rooms appear and vanish. When villains infiltrate, the castle becomes a crucial ally, helping the main character run, hide, and eavesdrop as needed.

The other world and other mother (Coraline by Neil Gaiman)

This novella is so deliciously creepy! Young heroine Coraline, dissatisfied with her boring life, goes through a mysterious door in her new flat. The door leads to another world, almost identical to her own, but much more exciting. Her other cat can talk, her other toys can fly, and her other neighbors perform fantastic circuses in their flats. Her other parents are the same, except they pay more attention to her and they have black buttons for eyes. But when her other mother tries to give Coraline a pair of buttons, she knows something is wrong.

The heartless wizard (Howl’s Moving Castle by Diana Wynne Jones)

The movie doesn’t do justice to this magical book. In the novel (spoiler alert), Wizard Howl gives his heart to his friend Calcifer, a fallen star who can’t survive without a heart of his own. Now Howl is incapable of falling in love, even when heroine Sophie falls in love with him. Luckily, Sophie has the magical gift of bringing inanimate objects to life. This allows her to give life to Calcifer, return Howl’s heart, and (duh) marry Howl and live happily ever after.

The planes of magic (the Bartimaeus series by Jonathan Stroud)

In this intelligent young adult fantasy, the more powerful a djinni, the more planes he exists on. Humans can see only the first plane, or the second if they wear special contact lenses, while less powerful djinnis can see the third and fourth. Reluctant hero Bartimaeus is an ancient and powerful djinni who exists on all seven planes—and he can change his appearance on each one individually. This comes in handy time and time again when he needs a good disguise.