public static boolean checkEntry(int[][] M,int i,int j){
		boolean valid = false;
		int[][] indexes = new int[4][2];
		indexes[0][0] = i-1;
		indexes[0][1] = j;
		indexes[1][0] = i;
		indexes[1][1] = j+1;
		indexes[2][0] = i+1;
		indexes[2][1] = j;
		indexes[3][0] = i;
		indexes[3][1] = j-1;
		for(int[] index:indexes){
			if (index[0]>=0 && index[1]>=0 && index[0]<=2 && index[1]<=2){
				if (M[index[0]][index[1]]==2){
					valid = true;
					return valid;
				}
			}
		}
		return valid;
	}