Updated with ngetN and nPut commands and some code cleanup.
-AJ