Added some code for serializing data.  Might not actually work.