vectorized the main contents of cv_assem