Qual: Code to output tree is now generic