changed getDepth in getParh