Introduce implementation of print tree layer by layer