initial cross-validation code