added extractEnvelope option