added method for reading and writing files