implemented read & write