When calculating the max_depth of the intersections, I think every intersection needs to be iterated over, not just the last set