modify mining.py