finish binary search