modify function binary_search