added update_pixel() function