Completed scattering codes in c and python