got rid of unsigned int to int comparisons