     private var mystic: CGFloat = 4
     private var turns: Int
     private var md: CGFloat
-    private let bgLayer: CAShapeLayer
-    private let fgLayer: CAShapeLayer
+    private var bgLayer: CAShapeLayer
+    private var fgLayer: CAShapeLayer
     private let pathAnimationGroup: CAAnimationGroup
     private var duration: CFTimeInterval
     private var reverses = false

        let pathAnimationIn = CABasicAnimation(keyPath: "strokeEnd")
        let pathAnimationOut = CABasicAnimation(keyPath: "strokeStart")
        let pathAnimationGroup = CAAnimationGroup()
        
        
        
        let startPos: CGFloat = 0.0
        let endPos: CGFloat = 1.0
        
        
        pathAnimationIn.fromValue = startPos
        pathAnimationIn.toValue = endPos
        pathAnimationIn.duration = duration / 2
        pathAnimationIn.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseIn)
        
        
        pathAnimationOut.fromValue = startPos
        pathAnimationOut.toValue = endPos
        pathAnimationOut.duration = duration / 2
        pathAnimationOut.beginTime = duration / 2
        pathAnimationOut.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut)
        
        
        pathAnimationGroup.animations = [pathAnimationIn, pathAnimationOut]
        pathAnimationGroup.duration = duration

    required public init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    public func updateLineColors(bgColor: UIColor, fgColor: UIColor, lineJoin: String = kCALineJoinMiter) {
        bgLayer = GridLogo.shapeLayerWithLogoPath(bgColor, lineJoin: lineJoin, lineWidth: lineWidth, turns: turns, md: md)
        fgLayer = GridLogo.shapeLayerWithLogoPath(fgColor, lineJoin: lineJoin, lineWidth: lineWidth, turns: turns, md: md)
    }
    
    
    public func show() {
        startAnimation()
        fgLayer.opacity = 1
        bgLayer.opacity = 1
        fgLayer.addAnimation(fadeInAnimation, forKey: "fade")
        bgLayer.addAnimation(fadeInAnimation, forKey: "fade")
    }
    
    public func hide() {
        fgLayer.opacity = 0
        bgLayer.opacity = 0
        fgLayer.addAnimation(fadeOutAnimation, forKey: "fade")
        bgLayer.addAnimation(fadeOutAnimation, forKey: "fade")
    }
    
    func startAnimation() {
        fgLayer.removeAllAnimations()
        fgLayer.addAnimation(pathAnimationGroup, forKey: "group")
    }
    
    func endAnimation() {
        fgLayer.removeAllAnimations()
    }
}