Added basic serialization functionality