add two Helper Functions: getSecIndex(), getGlobalDepth()