Added single output version of write example with different ways of reading