solved vectorization