search in a sorted 2-D matrix