added swap/ read/ and write, working on reverse