Optimization for voting