Binary-search method