final version of string-similarity that passes all test cases