fixed rms calculation