Problems in treeSort