separate out operators and generators so that recur works smoothly, and add some documentation