Changed getDistFromTop to getDepth