task 2.69 and output-tree method
task 2.70