add functors.jl in new way (tested)