read function works, write function must be tested