Began to implement adaptive thresholding. Switched order of mask/thresholding.