adding print method to subtrees