modified where (or when)  calc is executed in gamma.mod (reduce the times of calculation)
and comment out the debug comment