private void updateBonds(State xcurr) {
        double pb = 0;
        int x = 0;
        int y = 0;
        for (int i = 0; i < _dim; i++) {
            for (int j = 0; j < _dim; j++) {
                coord:
                for (int k = 0; k < 1; k++) {
                    if (k == 0) {
                        //Spin to right of i,j
                        if(j != _dim - 1) {
                            x = i;
                            y = j + 1;
                        } else {
                            break coord;
                        }
                    } else {
                        //Spin below i,j
                        if (i != _dim - 1) {
                            x = i + 1; 
                            y = j;
                        } else {
                            break coord;
                        }
                    }
                    pb = _glass.pbond(xcurr, sqNum(i, j), sqNum(x, y));
                    if (pb > 1) {
                        break coord;
                    } else if(_rand.nextDouble() < pb) {
                        _bonds[2*i - x][2*j - y] = true;
                    } else {
                        _bonds[2*i - x][2*j - y] = false;
                    }
                }
            }
        }
    }