for (int z = 0; z < chrText.Length; z++) { for (int y = 0; y < 16; y++) { for (int x = 0; x < 16; x++) { if (keyTable[y, x] == chrText[z]) { if (alpha.Contains(chrText[z])) { if (repeatCheckA.Count == 1) { repeatCheckA.Clear(); } else { int stage1x; int stage1y; stage1x = y; stage1y = x << 4; byte combined = (byte)(stage1x | stage1y); repeatCheckA.Add(combined); stage1final[z] = combined; } } else if (numeric.Contains(chrText[z])) { if (repeatCheckN.Count == 1) { repeatCheckN.Clear(); } else { int stage1x; int stage1y; stage1x = y; stage1y = x << 4; byte combined = (byte)(stage1x | stage1y); repeatCheckN.Add(combined); stage1final[z] = combined; } } else if (symbol.Contains(chrText[z])) { if (repeatCheckS.Count == 1) { repeatCheckS.Clear(); } else { int stage1x; int stage1y; stage1x = y; stage1y = x << 4; byte combined = (byte)(stage1x | stage1y); repeatCheckS.Add(combined); stage1final[z] = combined; } } } } } }