fixed magic wand implementation