Fixed bug in figure4 function. Updated generateThresholdCurves.