Implemented cumulative depth calculation