changed "unsigned int" to "unsigned" in for loops.