Reply if you have any doubts. public class Life { public static final int DEAD = 0; public static final int LIVING = 1; public static final int DYING = 2; public static final int BORNING = 3; private int size; private int[][] cells; /* Constructor is done. */ public Life(int size) { this.size = size; cells = new int[size][size]; } /* getSize is a stub. */ public int getSize() { return this.size; } /* setState is a stub. */ public void setState(int row, int col, int state) { cells[row][col] = state; } /* getState is a stub. */ public int getState(int row, int col) { return this.cells[row][col]; } /* evolve is a stub. */ public void evolve() { //Creating tempArray //only after full cycle cells should evolve int[][] TempCells = new int[size][size]; //looping through all the cells for(int i=0;i 3) { TempCells[i][j] = DEAD; } } else if(CurrentState == DEAD) { if(NeighbourCount == 3) { TempCells[i][j] = LIVING; } } } } //set the cells to nex gen states this.cells = TempCells; } /* getNumberOfNeighbors is a stub; note that it\'s private. */ private int getNumberOfNeighbors(int row, int col) { int neighbourX[] = new int[8]; int neighbourY[] = new int[8]; neighbourX[0] = row - 1; neighbourY[0] = col - 1; neighbourX[1] = row - 1; neighbourY[1] = col; neighbourX[2] = row - 1; neighbourY[2] = col + 1; neighbourX[3] = row; neighbourY[3] = col - 1; neighbourX[4] = row; neighbourY[4] = col + 1; neighbourX[5] = row + 1; neighbourY[5] = col - 1; neighbourX[6] = row + 1; neighbourY[6] = col; neighbourX[7] = row + 1; neighbourY[7] = col + 1; for(int i=0;i<8;i++) { if(neighbourX[i] < 0) neighbourX[i] = size - 1; if(neighbourY[i] < 0) neighbourY[i] = size - 1; if(neighbourX[i] >= size) neighbourX[i] = 0; if(neighbourY[i] >= size) neighbourY[i] = 0; } int count = 0; for(int i=0;i<8;i++) { count += this.cells[neighbourX[i]][neighbourY[i]]; } return count; } /* The main only instantiates the objects and sets them working. */ public static void main(String[] args) { Life life = new Life(25); CellWorld world = new CellWorld(life); } } Solution Reply if you have any doubts. public class Life { public static final int DEAD = 0; public static final int LIVING = 1; public static final int DYING = 2; public static final int BORNING = 3; private int size; private int[][] cells; /* Constructor is done. */ public Life(int size) { this.size = size; cells = new int[size][size]; } /* getSize is a stub. */ public int getSize() { return this.size; } /* setState is a stub. */ public void setState(int row, int col, int state) { cells[row][col] = state; } /* getState is a stub. */ public int getState(int row, int col) { return this.cells[row][col]; } /* evolve is a stub. */ public void evolve() { //Creating tempArray //only after full cycle cells should evolve int[][] TempCells = new int[size][size]; //looping through all the cells for(int i=0;i 3) { TempCells[i][j] = DEAD; } } else if(CurrentState == DEAD) { if(NeighbourCount == 3) { TempCells[i][j] = LIVING; } } } } //set the cells.