Overhaul engine to support arbitrary envelopes