updated CV logreg code