Added generateText method