fully functional miner + related bug fixes