created vote function