Changes in advGen code