added method for reading and writing files

this is not yet finished