change to lines function in plot3
this helps to create multiple lines in single graph easily
finished plot4.png and plot4.R