added CountCharacter codes