Fixed bug in PbEst, and added some simulation functionality.