documentation and example for Gain