             switch (type) {
             case .Left, .Right:
                 // For Half gauge you have to fill 50% of circle and round it wisely.
-                let percanage = rate / 20 % 0.5
-                ringLayer.strokeEnd = (rate >= 10 ? 0.5 : percanage + ((rate != 0 && percanage == 0) ? 0.5 : 0))
+                let percanage = rate / 2 / maxValue % 0.5
+                ringLayer.strokeEnd = (rate >= maxValue ? 0.5 : percanage + ((rate != 0 && percanage == 0) ? 0.5 : 0))
             case .Circle, .Custom:
-                ringLayer.strokeEnd = rate / 10
+                ringLayer.strokeEnd = rate / maxValue
             default:
-                ringLayer.strokeEnd = rate / 10
+                ringLayer.strokeEnd = rate / maxValue
 
             }
 

        }
    }

    /// Percantage of filling Gauge: 0..10
    @IBInspectable public var rate: CGFloat = 9 {
        didSet {
            updateLayerProperties()
        }

            //TODO: replace pre-defined colors with array of user-defined colors
            //TODO: and split them proportionally in whole sector
            if colorsArray {
                switch (rate / maxValue) {
                case let r where r >= 0.75:
                    strokeColor = UIColor(hue:
                    112.0 / 360.0, saturation:
