Serialisation Code. Deserialisation not working.