updated miner code