Better voting function