serialize grid