rename depth to max_depth