         if markedRange is NSRange {
             let range : NSRange = markedRange as! NSRange
             if  range.length > 0 {
-                let (x0,y0) = (barStartX, Double(range.location) * currentItemHeight)
-                let (x1,y1) = (viewWidth, Double(range.location + range.length) * currentItemHeight)
-                let rectanglePath = UIBezierPath(roundedRect: CGRect(x: CGFloat(x0!), y: CGFloat(y0), width: CGFloat(x1), height: CGFloat(y1)), cornerRadius: 10)
-                currentColor.setFill()
+                let (x0,y0) = (properties.barStartX, Double(range.location) * properties.currentItemHeight)
+                let (x1,y1) = (viewWidth, Double(range.location + range.length) * properties.currentItemHeight)
+                let rectanglePath = UIBezierPath(roundedRect: CGRect(x: CGFloat(x0), y: CGFloat(y0), width: CGFloat(x1), height: CGFloat(y1)), cornerRadius: 10)
+                properties.currentColor.setFill()
                 rectanglePath.fill()
             }
         }

        if arrayHasNumber() {
            for i in 0..<currentArray.count {
                let object : AnyObject? = currentArray.object(at: i) as AnyObject?
                let d : Double? = getDoubleForObject(object)
                if d != nil && min == nil {
                    min = d
                    max = d

        return (min!,max!)
    }
    
    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
        properties.currentColor.setStroke()
        path.stroke()
    }
    
    internal func drawLines(_ viewWidth: Double) {
        for i in 0..<currentArray.count {
            let y = Double(i) * properties.currentItemHeight
            drawLine(0, y0: y, x1: viewWidth, y1: y)
        }
    }
    
    func renderArray(_ array:NSMutableArray, maxCount: Int, markedRange: Any) -> UIImage {
        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)*properties.currentItemHeight))
        UIGraphicsBeginImageContextWithOptions(size, true, 0)
        UIColor.black.setFill()
        UIRectFill(CGRect(x: 0, y: 0, width: size.width, height: size.height))
