added cross validation method