using r+ and w+