 
 class KrkklView : ScreenSaverView
 {
-    var numrows = 100
+    var numrows = 10
     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]
+    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]
+    
+    var animState:String = "anim"
+    var fadeCount:Int = 0
+    var cubeCount:Int = 0
+    var maxCubes:Int = 100
     
     override init(frame: NSRect, isPreview: Bool) 
     {

    {    
        setup()
        super.startAnimation()
        setAnimationTimeInterval(1.0 / 30.0)
        needsDisplay = true
    }
        

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