finished plot4.R