finish binary search algorithms