change class Tree to GraphBuilder
accomandate  changes for graph