Add magic mode implementation.