changed ThresholdSearch to use Mode*