working on sum-product algorithm