add vectorization functionality