updated vote function