Added an example of splitting the read and write functions