clarify use of environment() in function

I think this may be better; a little longer but hopefully clearer.
Merge pull request #285 from ajschumacher/patch-33

clarify use of environment() in function