Add some comments to core.py