         return proposedEdgeColor!.color;
     }
     
-    private func findTextColors(imageColors:NSCountedSet, inout primaryColor:UIColor?, inout secondaryColor:UIColor?, inout detailColor:UIColor?, inout backgroundColor:UIColor?)
+    private func findTextColors(imageColors:Array<PCCountedColor>, inout primaryColor:UnsafeMutablePointer<UIColor>, inout secondaryColor:UnsafeMutablePointer<UIColor>, inout detailColor:UnsafeMutablePointer<UIColor>, inout backgroundColor:UIColor)
     {
         var curColor:UIColor
         
         var sortedColors:NSMutableArray = NSMutableArray(capacity: imageColors.count)
-        var findDarkTextColor:Bool = backgroundColor!.pc_isDarkColor()
+        var findDarkTextColor:Bool = backgroundColor.pc_isDarkColor()
         
         //for countedColor: PCCountedColor in imageColors as [PCCountedColor] {
         for index in 0...imageColors.count-1 {
             
-            var countedColor:PCCountedColor = imageColors.valueForKey(String(index)) as PCCountedColor
+            var countedColor:PCCountedColor = imageColors[index]
             
             var curColor:UIColor = countedColor.color.pc_colorWithMinimumSaturation(0.15)
             

    
    convenience init(inputImage:UIImage)
    {
        var scaledImage:UIImage = UIImage(CGImage: inputImage.CGImage, scale: CGFloat(0.3), orientation: inputImage.imageOrientation)!
        
        self.init(inputImage:scaledImage, threshold:2)
    }
    
    init(inputImage:UIImage, threshold:NSInteger)

        //for curContainer: PCCountedColor in sortedColors as [PCCountedColor] {
        for index in 0...sortedColors.count-1 {
            
            var curContainer:PCCountedColor = sortedColors[index] as PCCountedColor

            curColor = curContainer.color;
            
            if primaryColor == nil {
                if curColor.pc_isContrastingColor(backgroundColor) {
                    var primaryColor:UIColor = curColor;
                }
            } else if secondaryColor == nil {
                if primaryColor.memory.pc_isDistinct(curColor) || curColor.pc_isContrastingColor(backgroundColor) {
                    continue;
                }
                secondaryColor.memory = curColor;
            } else if detailColor == nil {
                if secondaryColor.memory.pc_isDistinct(curColor) || primaryColor.memory.pc_isDistinct(curColor) || curColor.pc_isContrastingColor(backgroundColor) {
                    continue;
                }
                
                detailColor.memory = curColor;
                break;
            }
        }
