Implemented read() and write()