modified gain reduction logic