added in serialization functionality