optimizing images, changing r squared to r.