- added functions required for cross validation and validation