corrctions for cross validation code