Changes for grayscale and searching