changed vectorization