modified tree, working prototype