Simplified makeFunction quite a bit more.