Fixing bug for plotting pixels on the screen being flipped