Added constructor to limit depth of tree.