added plots for both codes