refactoring calcWN8