 
         var x: CGFloat = thumbRect.midX
         let y: CGFloat = (frame.height-kFrameHeight)/2
-        let width: CGFloat = (frame.width - kFrameGap*(CGFloat(kNumStacks-1))) / CGFloat(kNumStacks)
+        let width: CGFloat = (frame.width - kFrameGap*(CGFloat(numberOfStacks-1))) / CGFloat(numberOfStacks)
         let height: CGFloat = kFrameHeight
 
         _stacks.forEach{


    open var currentIndex: Int {
        let valueRange = maximumValue - minimumValue
        let range = Int(((value - minimumValue)/valueRange) * Float(kNumStacks))
        let currentIndex = min(range, kNumStacks-1)
        return currentIndex
    }


            return
        }

        (0..<numberOfStacks).forEach { _ in
            let v = UIView(frame: CGRect.zero)
            v.backgroundColor = UIColor.black
            v.layer.borderWidth = 0.5
