proper vectorization