Added grayscale funciton.