generate_phonemes -- ensure the final phoneme is outputted correctly