Make max_nf a parameter of the form