Updated the binary_search algo