Added master gain and tweaked seqiemcomg code.