     
     func setup() 
     {
+        cubeCount = 0
         numrows = randint(30)+10
         
         // start at centre


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) 
    {

        }

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