addedposibility to write and read from file