Updating core.py to latest version