private Cell getCell(int x, int y) {
        if (x < 0 || x >= size || y < 0 || y >= size) {
            throw new IllegalArgumentException(
                    "Non valid coordinates are being accessed");
        }
        return board[x][y];
    }