removed maxDepth() code to be recoded