change format and change declaration of metadata to uint16_t