Added histogram determination of upper depth limit