Adjusting the algorithm for only thresholding