Added comments to core.py