adding plot4.R code