cross-validation computation optimized