work towards tree structure