implementing an Environment object instead of just using a dict