Miscellany, potential thresholding algorithm