changed int8_t to unsigned char