created plotting codes and plots