updated contrast plot code