updated array to be generic, added token for EOF