update countCharacters