Changed int types to unsigned int to turn off warnings