some changes

-asks for apth to file
-faster regex
-new method to write
-new method to delete duplicates