raw code and plots