Implemented read and write for lab 6.