changed some code to earlier way to make naive bayes example work again