fix maxDepth, finish 4.1