more improvements in nreg.py