remove dependency on gain function