njw algo actually implemented and working