Adding tests for thresholding