working on tree problems