Some changes in checkPixel