used a tree structure