         self.cols = target.cols
         self.result = target
         self.process = []
+        self.maxItr = {
+            switch mode {
+            case .Both: return min(target.rows, target.cols)
+            case .Rows: return target.rows
+            case .Cols: return target.cols
+            }
+        }()
     }
     
     func run() {
-        let maxItr: Int = {
-            switch mode {
-            case .Both: return min(rows, cols)
-            case .Rows: return rows
-            case .Cols: return cols
-            }
-        }()
+        log("-----Start (mode: \(mode))-----\n\n\(result.alignedDescription)\n")
         
         while itr < maxItr {
             if iteration() {

        let doCols = (mode != .Rows)

        guard var (i0, j0) = next() else {
            return false
        }
        
        elimination: while true {

        let doCols = (mode != .Rows)
        
        guard var (i0, j0) = next() else {
            if mode == .Both { // The area left is O. Exit iteration.
                return false
            } else {           // The target row/col is O. Continue iteration.
                return true
            }
        }
        
        if doRows && i0 > itr {
