updated using nag library