complete njm implementation