public void open(int row, int col) {
    validate(row);
    validate(col);
    if (!isOpenV(row, col)) {

      // open it
      int idx = index(row, col);
      open[idx] = true;

      // connect UP
      if (row == 1) { // if row = 1 connect to TOP
        uf.union(idx, theTOP);
        ufFull.union(idx, theTOP);
      } else if (isOpenV(row - 1, col)) { // if UP isOpen connect to it
        int dest = index(row - 1, col);
        uf.union(idx, dest);
        ufFull.union(idx, dest);
      }

      // connect LEFT
      if (col > 1 && isOpenV(row, col - 1)) {
        int dest = index(row, col - 1);
        uf.union(idx, dest);
        ufFull.union(idx, dest);
      }

      // connect RIGHT
      if (col < N && isOpenV(row, col + 1)) {
        int dest = index(row, col + 1);
        uf.union(idx, dest);
        ufFull.union(idx, dest);
      }

      // connect DOWN
      if (row == N) {
        uf.union(idx, theBOTTOM);
      } else if (isOpenV(row + 1, col)) { // if UP isOpen connect to it
        int dest = index(row + 1, col);
        uf.union(idx, dest);
        ufFull.union(idx, dest);
      }
    }
  }