Added cross validation functionality