now calculates gain and pushes it to the fit data stream.