added naive_bayes_i function