implemented serialization functionality.
forgot to add some files.