anchor.diff:          }
       }
   
  -    void updateElem(GridPoint p, int lvl) {
  -        grid.setElem(p, new Elem(lvl));
  -        if (lvl != 0) {
  -            var x = boxBorderSize + (p.x*stepSizeX) + (boxDimX/2);
  -            var y = boxBorderSize + (p.y*stepSizeY) + (boxDimY/2);
  -            ctx.fillStyle = "black";
  -            ctx.fillText(lvl.toString(), x, y);
  -            print(lvl.toString());
  -        }
  -    }
  -
  -    void addItem(num x, num y) {
  -        GridPoint sq = getGridCoords(x,y);
  -
  -        if (sq == null)
  +    void setPoint(num x, num y) {
  +        GridPoint p = getGridCoords(x,y);
  +        if (p == null)
               return;
   
  -        if (!grid.getElem(sq).isEmpty())
  +        if (!grid.getElem(p).isEmpty())
               return;
   
  -        updateElem(sq, 1);
  +        var updated = grid.setPoint(p);
  +        for (var u in updated)
  +            drawGridElem(u);
  +
       }
   }
   
  
positive.code:     });
  
      canvas.onMouseDown.listen( (e) {
          dg.addItem(e.client.x, e.client.y);
      });
  
      // TODO: match 3 mechanic
  }
  
negative.code:         return elems[p.y*x + p.x];
      }
  
      bool validPoint(GridPoint p) {
          return (p.x >= 0 && p.x < x && p.y >= 0 && p.y < y);
      }
  
      Iterable<GridPoint> neighbors(GridPoint p) {
          return moves.map((m) => new GridPoint.fromMove(p,m))
                      .where(validPoint);
      }
  
      Set<GridPoint> matchingPoints(GridPoint p) {
          Elem e = getElem(p);
          Set<GridPoint> s = new Set.from([p]);
          Set<GridPoint> boundary = s;
          while (true) {
              Set<GridPoint> s_new = new Set();
              for (GridPoint o in boundary)
                  s_new.addAll(neighbors(o).where(
                          (x) => getElem(x).equal(e) && !s.contains(x)
                  ));
  
              if (s_new.length == 0)
                  break;
  
              s.addAll(s_new);
              boundary = s_new;
          }
  
          return s;
      }
  
      // set an element in the grid, return the updated points that need to be
      // redrawn
      Set<GridPoint> setPoint(GridPoint p) {
          int level = 1;
          Elem e = elems[p.y*x + p.x];
          assert(e.isEmpty());
  
          var ret = new Set();
          while (true) {
              e.level = level;
  
              var matchedPs = matchingPoints(p);
              ret.addAll(matchedPs);
              if (matchedPs.length < 3)
                  break;
  
              for (GridPoint mp in matchedPs)
                  elems[mp.y*x + mp.x].level = 0;
  
              level++;
          }
  
         return ret;
      }
  
      void incElem(int xi, int yi, int lvl) {
         elems[yi*x + xi].level += 1;
      }
  }
  
  