Implementation of some read/write functions.  So far so good.