Added GainTable class (from Hagen, Sven) with corrections