first try at implementing bayes theorem