Adding solution for tree builder