added a sample for read/write