Belief propagation update

Fixed a bug and updated the example.

i think the changelog contains the difference from master because I rebased...