added max/min depth