Working main file with NB Bernoulli