solution for plot1
solution for plot2
solution for plot3
solution for plot4