reading and writing the file is working properly in this version.