private int countNeighbours(Point p) {
				int count = 0;
				for(int dx = -1; dx <= 1; dx++)
					for(int dy = -1; dy <= 1; dy++) {
						Point neighbour = new Point(p.x + dx, p.y + dy);
						if ((dx != 0 || dy != 0) && neighbour.x >= 0 && neighbour.x < size.height 
								&& neighbour.y >= 0 && neighbour.y < size.width && grid.getState(neighbour) == CellState.ALIVE)
							count++;
					}
				return count;
			}