Added: Serialize and deserialize fuctions