add new data structure to allow bayes decision. Scheme of bayes function