improvements in nreg.py