modest implementation of NB