Written all packing/unpacking functions