Many changes in algorithym, added cross validation...