Added pure MinMax algorithm with tests.