added auto gain