     @IBInspectable public var fontColor: UIColor = UIColor.black
     @IBInspectable public var valueMultiplier: Double = 100
     
-    let ringLayer = CAShapeLayer()
-    let thumbLayer = CALayer()
-    let imgView = UIImageView()
-    var thumbImageView = UIImageView()
-    var arcPath = UIBezierPath()
+    
+    
+    
+    
+    
+    private let ringLayer = CAShapeLayer()
+    private let thumbLayer = CALayer()
+    private let imgView = UIImageView()
+    private var thumbImageView = UIImageView()
+    private var arcPath = UIBezierPath()
+    
+    
     
     // Arc animation notify Delegate
     public var delegate: KXArcNotifyDelegate?
+    
+    
+    
+    
+ 
+    //designated init
+    
+    public init(ringWidth: CGFloat, ringHeight: CGFloat,backgroundColor: UIColor, ringBackgroundColour: UIColor,  ringForegroundColour: UIColor, foreGroundArcWidth: CGFloat, backGroundArcWidth: CGFloat, arcStartAngle: CGFloat,
+                arcEndAngle: CGFloat, arcMargin: CGFloat) {
+        
+        
+        self.ringBackgroundColour   =   ringBackgroundColour
+        self.ringForegroundColour   =   ringForegroundColour
+        self.foreGroundArcWidth     =   foreGroundArcWidth
+        self.backGroundArcWidth     =   backGroundArcWidth
+        self.arcStartAngle          =   arcStartAngle
+        self.arcEndAngle            =   arcEndAngle
+        self.arcMargin              =   arcMargin
+        
+        
+        super.init(frame: CGRect(x: 0, y: 0, width: ringWidth, height: ringHeight))
+        super.backgroundColor = backgroundColor
+        
+    }
+    
+    
+    required public init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    
+    
+    
     
     public override func draw(_ rect: CGRect) {
         

        layer.addSublayer(ringLayer)
        animateArc(loaderValue: CGFloat(self.animateScale)) // changed here
    }
    
    
    

    //   @IBInspectable var highLevelColor: UIColor       = UIColor.green
    
    // must be between [0,100]
    
    
    
    
    //ring animate scale property 
    
    @IBInspectable public var animateScale: Double = 0.0
    
    //width of the rings
    
    @IBInspectable public var foreGroundArcWidth: CGFloat   = 20
    @IBInspectable public var backGroundArcWidth: CGFloat   = 8
    
    
    // turn this on to show image at the arc leading tip 
    
    @IBInspectable public var isthumbImageAvailable: Bool = false
    @IBInspectable public var thumbImage: UIImage?
    
    // set the start and end engle here
    
    @IBInspectable public var arcStartAngle: CGFloat = 120
    @IBInspectable public var arcEndAngle: CGFloat = 60
    
    
    
    @IBInspectable public var arcMargin: CGFloat = 75
    
    
    
    
    
    
    
    // turn this on to display  Image or Text at the center
    @IBInspectable public var showImage: Bool = false
    @IBInspectable public var image: UIImage?
    
