added reduced memory in cross validation