vectorize better