formatting changes and broke down environment.py into smaller functions