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

    int idx = index(row, col);
    if (!isOpenV(idx)) {

      // open it
      open[idx] = true;

      // connect UP
      if (row == 1) { // if row = 1 connect to TOP
        if (toBottom[idx]) {
          percolates = true;
        }
        ufTop.union(idx, theTOP);
      } else { // if UP isOpen connect to it
        connectIfDestOpen(idx, row - 1, col);
      }

      // connect LEFT
      if (col > 1) {
        connectIfDestOpen(idx, row, col - 1);
      }

      // connect RIGHT
      if (col < N) {
        connectIfDestOpen(idx, row, col + 1);
      }

      // connect DOWN
      if (row == N) {
        if (toTop[idx]) {
          percolates = true;
        }
      } else { // if UP isOpen connect to it
        connectIfDestOpen(idx, row + 1, col);
      }

    }
  }