Modified plot4.R