modified the binary search, a very important one
searchRange