final version for bayesian working memory