added correct tree-edit distance implementation