add n-fold cross-validation, do some tests