added function for generating text