some autodiff code edits
generating functions draft