updates to envelope segmentation