fix implementation of binary search tree range query method and test