updated plot4.R file