update codes and plots