made file writer and reader