got the edit distance function working, will finish this tomorrow