added serialization code