made the min max function return 2 matrices with 1 meaning True