fix typo
try to salvage unfinished functor code
add seemingly-working functorization, tests