Updated Naive Bayes classifier algorithm