construct tree max depth