finish binary_search version