Improved code for voting to prevent gaming.