receive environment as argument
Merge pull request #305 from tkellen/envarg

receive environment as argument