change alignment to adaptive thresholding