got thresholding working