thresholding merged into randomization script