added cross-validation