Add magic encondig

As issue #5