init edit distance