better doc for params and some checking of generated fns. needs more