     }
     
     func calculateKMeans() -> [Pixel] {
-        return kMeans(points: pixels, K: 4, minDiff: 2.0)
+        return kMeans(points: pixels, K: 4, minDiff: 5.0)
     }
     
     public func pixel(x: Int, y: Int) -> Pixel? {

        
        let s: Float = rd * rd + gd * gd  + bd * bd
        
        return sqrtf(s)
    }
    
    fileprivate func calculateCentre(points: [Pixel]) -> Pixel {

            clusters.append(points[Int(idx)])
        }
    
        
        while true {
            
            var plists: [Int: [Int]] = [0: [], 1: [], 2: [], 3: []]
            
            for (i, pixel) in points.enumerated() {
                var smallestDistance: Float = 10000000.0
                var index = 0
