adding codes and plots