cross-validation issue fixed: in some cases, a given sample could be mistakenly selected twice into test set