Adding estimate funtion to belief propagation