use unsigned int when appropriate