for(int n = 0; n < matchPosition.length; n++){ for(int m = 0; m < 8; m++) { if(matchPosition[n + 1] == relationshipGrid[matchPosition[n]][m]){