updated nH package, refactoring