Updated improvedNfg script