First draft of function generation section