make enclose calculation of depth