completed the serializing and file read/write stuff