         return (min!,max!)
     }
     
-    fileprivate func getPercentageInRange(_ d : Double, min : Double, max : Double) -> Double {
-        let delta = max - min
-        if delta != 0 {
-            let percentage = d / delta
-            return percentage
-        }
-        return 0
-    }
-    
     internal func drawLine(_ x0:Double,y0:Double,x1:Double,y1:Double) {
         let path = UIBezierPath()
         path.move(to: CGPoint(x: CGFloat(x0), y: CGFloat(y0)))
         path.addLine(to: CGPoint(x: CGFloat(x1), y: CGFloat(y1)))
         path.lineWidth = 0.5
-        currentColor.setStroke()
+        properties.currentColor.setStroke()
         path.stroke()
     }
     
     internal func drawLines(_ viewWidth: Double) {
         for i in 0..<currentArray.count {
-            let y = Double(i) * currentItemHeight
+            let y = Double(i) * properties.currentItemHeight
             drawLine(0, y0: y, x1: viewWidth, y1: y)
         }
     }
-
-    func getStringWidth(_ string: NSString) -> Double {
-        let size : CGSize = string.size(attributes: [NSFontAttributeName: UIFont.systemFont(ofSize: CGFloat(currentFontHeight))])
-        return Double(size.width)
-    }
     
     func renderArray(_ array:NSMutableArray, maxCount: Int, markedRange: Any) -> UIImage {
-        currentFontHeight = 10.0
-        currentItemHeight = currentFontHeight + 2.0
+        properties.currentFontHeight = 10.0
+        properties.currentItemHeight = properties.currentFontHeight + 2.0
         currentArray = array
         let viewWidth = 200.0
-        let size = CGSize(width: CGFloat(viewWidth),height: CGFloat(Double(maxCount)*currentItemHeight))
+        let size = CGSize(width: CGFloat(viewWidth),height: CGFloat(Double(maxCount)*properties.currentItemHeight))
         UIGraphicsBeginImageContextWithOptions(size, true, 0)
         UIColor.black.setFill()
         UIRectFill(CGRect(x: 0, y: 0, width: size.width, height: size.height))

        //
        let leftMarginX : Double = 2
        let lastIndexString = "\(maxCount-1)"
        let indexSpace = getStringWidth(lastIndexString as NSString) + 2
        let objectLineX = leftMarginX + indexSpace
        let objectDescX = objectLineX + 2
        currentColor = UIColor.gray
        drawLines(viewWidth)
        drawLine( objectLineX, y0: 0, x1:objectLineX, y1: Double(size.height))
        currentColor = UIColor(red: 106.0/255.0, green: 172.0/255.0, blue: 218.0/255.0, alpha: 0.7)
        barStartX = objectDescX
        drawBarsIfNumbers(viewWidth)
        currentColor = UIColor.white
        drawIndices(leftMarginX)
        drawObjectDescriptions(objectDescX)
        currentColor = UIColor(red: 0.2, green: 0.2, blue: 0.7, alpha: 0.5)
        drawRange(viewWidth, markedRange:markedRange)
        let image = UIGraphicsGetImageFromCurrentImageContext()
        UIGraphicsEndImageContext()

    internal func drawObjectDescriptions(_ xPos:Double) {
        let paragraphStyle = NSParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle
        paragraphStyle.lineBreakMode = NSLineBreakMode.byTruncatingTail
        let textFontAttributes: [String: Any] = [NSFontAttributeName: UIFont.boldSystemFont(ofSize: CGFloat(properties.currentFontHeight)), NSForegroundColorAttributeName: properties.currentColor, NSParagraphStyleAttributeName: paragraphStyle]
        for i in 0..<currentArray.count {
            let y = Double(i) * properties.currentItemHeight
            let desc = objectDescription(currentArray.object(at: i) as AnyObject?)
            desc.draw(at: CGPoint(x: CGFloat(xPos), y: CGFloat(y)), withAttributes: textFontAttributes)
        }
    }
    
    fileprivate func arrayHasNumber()->Bool {
        for i in 0..<currentArray.count {
            let object : AnyObject? = currentArray.object(at: i) as AnyObject?
            if utils.isObjectANumber(object) {
                return true
            }
        }
