added comments and plot4