added vote logic