implement sequence serialization