made changes to check the existence of the csv files and removed unused imports