Added n-ary tree, record function