Updated core.py to the correct code