whoa whoa whoa - R functions can return functions?  my life just improved, as did this codebase