New vectorization for logistic regression