modify to use setPixels