added finishing touches to magic.py
added finishing touches to magic.py