Light correcting light with nonlinear optics