added basic reading from file and writing to file