cleaned up cross.validation.R, need testing