Updated binary search