Modify queries2.py to work with buildTree.