changed the loop to display a word by keypress