Update core.py

Subtract the threshold