minor refactor
implement Environment class
make part 4 tests pass