Added serialize/deserialize methods and hooked them up