Added cross-validation, needs more parameterization.