simplify binary search