Added the first cut of the implementation of the read and write functions