cross validation in place