added code and plots for plots 5 and 6