clarify use of environment() in function

I think this may be better; a little longer but hopefully clearer.