added max depth to output