Adding solution to a tree problem