adjusted createEnv function and adjusted a few indents.