commiting all changes to magic.py and corresponding codes for final commit