implement generateSentence