added model validation and model testing