make minor corrections in generate function