added rivsIndex to cross-validation