add binary search function.