clean up getMaxDepth, printing