parse_env and write_file function added. Stress tests cleaned up.