make sample size depend on environment
added doubling method