working on tree iterator