A good starting base. The fancy functions will live in magic.py