added gain feature