change document structure. Fix bug with wrong function name measureDepth