added character counter with an array of ints