Text Generator Logic