added maxDepth.java