switched from AnonymousFunction back to Function