not working but the main idea of the miner