added some result generation code and cross validation
early stopping code