added a function counting NBC