verified correct tree creation