working on frequent words with mismatches problem