Adding tree loop