fixed partDist function that constructs a matrix with levenshtein distance