Improved mine_votes script