rewrite polarization correction (in progress)