Rewriting the check_ncpa as it needed some refactoring and it was not completely clear how it was working. Added some tests.