modulate cross validation code