Update core.py

Adding the debug stuff.