now the program stops correctly when you tell it to, and the miner shuts down and starts up the correct way.