Adding preference for two-char matches

Two-character matches are preferred.
If last char in string is a match add it if not part of two-char match