Added crossvalidation functionality