two ways of generating