Added -max_grad_dist <D>.
Seach beyond immediate neighbors (distance D) for gradients.