Improved speed of processing dat file using sets.