store characters in data structure