Working version with blocking of min and max determination. Tested for error rate 1E-3 and Num-nodes 200