changes in graph writing/reading from file