VERY IMPORTANT:

-                var base_environment = closure_environment(acc);
+                var base_environment =
closure_environment(acc).slice(0);

this part has problem!!!!!!
I need to copy closure_environment in case of problem