query A implemented, but doesn't get proper results because binary search is still broken