Modifies functions to add environment with statements.