vote logic