Update belief propagation code.