             {
                 for h in holes
                 {
-                    blackHolesRandomizations(ctx, randomize1: randomize1, randomize2: randomize2, randomize3: randomize3, randomize4: randomize4)
+                    blackHolesRandomizations(ctx: ctx, randomize1: randomize1, randomize2: randomize2, randomize3: randomize3, randomize4: randomize4)
                     
-                    CGContextSaveGState(ctx)
-                    CGContextTranslateCTM(ctx, getPossibleBlackHoleOffsetForTranslate(), getPossibleBlackHoleOffsetForTranslate())
-                    CGContextFillEllipseInRect(ctx, h)
-                    CGContextStrokeEllipseInRect(ctx, h)
-                    CGContextRestoreGState(ctx)
+                    ctx.saveGState()
+                    ctx.translateBy(x: getPossibleBlackHoleOffsetForTranslate(), y: getPossibleBlackHoleOffsetForTranslate())
+                    ctx.fillEllipse(in: h)
+                    ctx.strokeEllipse(in: h)
+                    ctx.restoreGState()
                 }
                 
             }

        {
            if fullRandomize
            {
                carpetsRandomizations(ctx, randomize1: randomize1, randomize2: randomize2, randomize3: randomize3)
            }
            
            CGContextMoveToPoint(ctx, matrixStart[i].x, matrixStart[i].y)
            CGContextAddLineToPoint(ctx, matrixEnd[i].x, matrixEnd[i].y)
            CGContextStrokePath(ctx)
        }
    }
    
    private func addRandomFinalMix(ctx:CGContextRef)
    {
        switch Helper.randomBetween(0, max: 4, includeMax: true)
        {
        case 0:
            
            drawTriangles(ctx)
            
        case 1:
            
            drawCirclesOrSquaresOverlay(ctx)
            
        case 2:
            
            drawTriangles(ctx)
            drawCirclesOrSquaresOverlay(ctx)
            
        case 3:
            
            drawCirclesOrSquaresOverlay(ctx)
            drawTriangles(ctx)
            
        default:
            

            let newIndex = Int(arc4random_uniform(UInt32(self.count-index))) + index
            if index != newIndex
            { // Check if you are not trying to swap an element with itself
                self.swapAt(index, newIndex)
            }
        }
    }
