generate-function implemented; addresses #27, does not isolate yet