Modified order of while statement for construct_sentence in case prev_word is nil