private int getNrBlacks(int x, int y) {
		int number = 0;
		for (int i=(x>0?x-1:0); i<=x+1 && i<width; i++) {
			for (int j=(y>0?y-1:0); j<=y+1 && j<height; j++) {
				if (black[i][j] != null)
					number += black[i][j] ? 1 : 0;
			}
		}
		return number;
	}