added kwargs to generate