revert code block
Add generate2 method

Add the method with new function prototype to make it very generic to
apply generator arguments.