adding serialization and cloning to examples