set_envirnment code snippit