Changed chars to use a buffer of ints instead of a dictionary