BST comparer