Started writing mining.py code