Apply binary search algorithm (#739)