implement vote function