Add documentation for serialize