binary search algorithm for notes