multiple environments

per issue #1124

an implementation of the functionality requested.