fixed bug where an unsigned int would cycle around 0