search for a range using binary search