Bayesian Filtering And Sorting