     static let xstep = [1,0,-1,0]
     static let ystep = [0,1,0,-1]
     
-    static func shapeLayerWithLogoPath(strokeColor: UIColor, lineJoin: String, lineWidth: CGFloat, turns: Int, md: CGFloat) -> CAShapeLayer {
+    static func shapeLayerWithLogoPath(
+        strokeColor: UIColor,
+        lineJoin: String,
+        lineWidth: CGFloat,
+        turns: Int,
+        md: CGFloat
+        ) -> CAShapeLayer {
+            var curr = CGPointZero
+            var last = CGPointZero
+            var scalestep: CGFloat
+            let path = UIBezierPath()
+            path.moveToPoint(curr)
         
-        var curr = CGPointZero
-        var last = CGPointZero
-        var scalestep: CGFloat
-        let path = UIBezierPath()
-        path.moveToPoint(curr)
-        
-        for i in 0 ..< turns {
-            scalestep = round((CGFloat(i) + 1) / 2.0) * CGFloat(md)
-            curr = CGPoint(x: CGFloat(last.x) + (scalestep * CGFloat(xstep[i % 4])), y: CGFloat(last.y) + (scalestep * CGFloat(ystep[i % 4]))).toInt()
-            
-            if i + 1 == turns {
-                curr = CGPoint(x: CGFloat(curr.x) - (md * CGFloat(xstep[i % 4])), y: CGFloat(curr.y) - (md * CGFloat(ystep[i % 4]))).toInt()
+            for i in 0 ..< turns {
+                scalestep = round((CGFloat(i) + 1) / 2.0) * CGFloat(md)
+                curr = CGPoint(x: CGFloat(last.x) + (scalestep * CGFloat(xstep[i % 4])), y: CGFloat(last.y) + (scalestep * CGFloat(ystep[i % 4]))).toInt()
+                
+                if i + 1 == turns {
+                    curr = CGPoint(x: CGFloat(curr.x) - (md * CGFloat(xstep[i % 4])), y: CGFloat(curr.y) - (md * CGFloat(ystep[i % 4]))).toInt()
+                }
+                
+                path.addLineToPoint(curr)
+                last  = curr
             }
             
-            path.addLineToPoint(curr)
-            last  = curr
-        }
-        
-        let shapeLayer = CAShapeLayer()
-        shapeLayer.path = path.CGPath
-        shapeLayer.strokeColor = strokeColor.CGColor
-        shapeLayer.fillColor = nil
-        shapeLayer.lineWidth = lineWidth
-        shapeLayer.lineJoin = lineJoin
-        return shapeLayer
+            let shapeLayer = CAShapeLayer()
+            shapeLayer.path = path.CGPath
+            shapeLayer.strokeColor = strokeColor.CGColor
+            shapeLayer.fillColor = nil
+            shapeLayer.lineWidth = lineWidth
+            shapeLayer.lineJoin = lineJoin
+            return shapeLayer
     }
     
     static func setupAnimation(duration: CFTimeInterval, repeatCount: Float) -> CAAnimationGroup {

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

        return animation
    }()
    
    public init(
        mystic m: CGFloat,
        duration d: CFTimeInterval,
        lineWidth lw: CGFloat = 1,
        bgColor: UIColor = UIColor(red: 51/255, green: 51/255, blue: 48/255, alpha: 1),
        fgColor: UIColor = UIColor(red: 1, green: 246/255, blue: 153/255, alpha: 1),
        lineJoin: String = kCALineJoinMiter,
        turns t: Int = 9,
        repeatCount: Float = 14
        )
    {
        mystic = m
        duration = d
        lineWidth = lw
        md = m
        turns = t
        bgLayer = GridLogo.shapeLayerWithLogoPath(bgColor, lineJoin: lineJoin, lineWidth: lineWidth, turns: turns, md: md)
        fgLayer = GridLogo.shapeLayerWithLogoPath(fgColor, lineJoin: lineJoin, lineWidth: lineWidth, turns: turns, md: md)
        pathAnimationGroup = GridLogo.setupAnimation(duration, repeatCount: repeatCount)
        
        super.init(frame: CGRectZero)
        
        layer.addSublayer(bgLayer)
        layer.addSublayer(fgLayer)
        userInteractionEnabled = false
