finalized the serialize stuff