public int surround(int y, int x, int[][] image){
		int counter = 0;
		for(int i = y - 1; i <= y+1; i++)
			for(int j = x -1; j <= x+1; j++){
				try{
					if(image[i][j] == -16777216)
						counter++;
				}catch(Exception e){;}
			}

			if(image[y][x] == -16777216)
				counter--;
			return counter;
		}