use unsigned int instead of uint16_t