build_tree
building trees
working solution