some tools for calculating statistics, and naive bayes