adding a new modules and refactoring the bayesian logic