added regularization to distortion correction tool