Miner stuff. Has no test, but is pretty straightforward.