Wrote an implementation of the sum-product algorithm and parnially translated a demo from the original MATLAB toolkit.