replaced if block with nested switchs, checks total mined etc