solved problem with stringdistmatrix