Implemented persistency in writeToFile.
Implemented readFromFile.