updated to allow config using environment variables