add the serialize method.
simple serializer impl.