finished the computation of unit density in an envelope