adding code to compute marginal likelihoods