Moving to OO development, phase 4 - bugfix, now belief propagation seems to work