working naive bayes classifier