update loops of classify_NB method