casting unsigned int to int to remove warnings