zhang and feng scripts working, need to re-calculate kappa