public int liveNeighbours(int x, int y) {
		int liveNeighbours = 0;
		
		for(int i = -1; i <= 1; i++) {
			int corY = y+i;
			for(int j = -1; j <= 1; j++) {
				int corX = x+j;
				if(corX >= 0 && corY >= 0 && corX < gridSize && corY < gridSize && (corX != x || corY != y)) {
					if(state[corY][corX] == 1)
						liveNeighbours++;
				}
			}
		}
		return liveNeighbours;
	}