draft of cross validation framework