TODO note. Need to speed up time spent in cv_predict function.