First complete version of env.py