Refactored plotting code and translated the program to english