Changed the parameters of printTree and rPrintTree