create VALUE and MEMORY versions of functions