- Move checking if there is a prev compare string char match into function - Move updating of index list when a better match is found for the first substring logic into function