unroll a function