new function 'generate'
add export