bp1 - using decoding algorithm from Radford Neal
fixed bug in decoder