         if rating - Float(i) + 1 >= 0.5 {
             let star = stars[i-1]
             star.image = halfImage
-            i++
-        }
-        
-        
-        for ; i <= starCount; i++ {
+            i += 1
+        }
+        
+        while i <= starCount {
             let star = stars[i-1]
             star.image = offImage
+            i += 1
         }
     }
 }

                rating = Float(i) + 0.5
                return
            }
        }
        
        rating = 0
    }

        if onImage == nil {
            onImage = UIImage(named: "starryStars_on", inBundle: bundle, compatibleWithTraitCollection: self.traitCollection)
        }
        
        if halfImage == nil {
            halfImage = UIImage(named: "starryStars_half", inBundle: bundle, compatibleWithTraitCollection: self.traitCollection)
        }
