simplify nest.fun2 (remove nested function)