final version + plot file