Changed the environment to be a stack of scopes