         }
 
         drawCube(color: NSColor.greenColor(), skip: skip)
+        
+        cubeCount += 1
     }
     
     func drawCube(#color: NSColor, skip: Int)


class KrkklView : ScreenSaverView
{
    var numrows = 100
    var pos:     (x: Int, y: Int) = (0, 0)
    var size:    (x: Int, y: Int) = (0, 0)
    var center:  (x: Int, y: Int) = (0, 0)

    var lastPos:Int = 0
    var nextPos:Int = 0
    var reset: String = "random" // what happens when the screen border is touched: "wrap", "center" or "random"
    var keepdir: [Float] = [0,0,0,0,0,0,0]
    
    override init(frame: NSRect, isPreview: Bool) 
    {


        case 3: // down
                pos.y -= 1
                if cubeCount > 0 { skip = 0 } // dont paint top

        case 4: // back left
                if (pos.x%2)==0 { pos.y += 1 }
                pos.x -= 1
                if cubeCount > 0 { skip = 2 } // dont paint right

        case 5: // back right
                if (pos.x%2)==0 { pos.y += 1 }
                pos.x += 1
                if cubeCount > 0 { skip = 1 } // dont paint left
            
        default:
                break
