functor works correctly