fix edit distance bug
better output