environment is now an optional reference instead of a pointer