moved default gg_kappa "in range"
optimized and fixed the code; some bad bug still