update pseudocode for remove_word