added minmax code
added test2