New implementation of Nb as well, still buggy. Added more tests.