adding gain control