changing NSUInteger to unsigned int to prevent crash on arm64 (iPhone 5s)