Added untested reading and writing functionality.