matrxi binary search fixed and tested