modify gen.memoizer and its examples