edit distance -- code from wikipedia tho :o