use depth to accelerate search