finalize tree edit distance algorithm