bug

cannot fix when the last word is a word that needs to be deleted