modifications to wgs script