nb function now takes care of normalization