tree with shared pointers