binary search in dictionary