     {0,  'z',  '%'}, //B10101
     {0,  'y',  '?'}, //B10110
     {0,  'x',  'x'}, //B10111
-    {0,  'i',  '2'}, //B11000
+    {KEY_LEFT_CTRL ,  'i',  '2'}, //B11000
     {0,  'l',  '£'}, //B11001
-    {0,  'r',  ';'}, //B11010
+    {0 /* win */,  'r',  ';'}, //B11010
     {0,  'w',  ':'}, //B11011
-    {0,  'd',  '3'}, //B11100
+    {0 /* alt */,  'd',  '3'}, //B11100
     {0, '\'',  '&'}, //B11101
-    {0,  'f',  '4'}, //B11110
+    {0 /* clear state */,  'f',  '4'}, //B11110
     {0,  'p',  '5'}  //B11111
 };
+
+#define TOGGLE_COUNT 24
+bool toggles[TOGGLE_COUNT] = {};
+
+char prevInput = 0;
+char prevCharacter = 0;
 
 char currentLayer = ALPHA_LAYER;
 bool commandClear = true;

  return (~(PINB >> 1)) & B00111111;
}

char decodeInput(char input) {
  if (input & 1) {
    switch(input){
      case B000001:
        Keyboard.press(KEY_LEFT_SHIFT);
        break;
      case B000011:
        Keyboard.releaseAll();
        currentLayer = ALPHA_LAYER;
        break;
      case B001101:
        currentLayer = NUMERIC_LAYER;
        break;
    }
    commandClear = false;
    return layers[input >> 1][CMD_LAYER];

  }
}

void loop() {
  char firstRead = readButtons();
  delay(25);
  char secondRead = readButtons();
  if (firstRead == secondRead) {
    if (firstRead != prevInput) {
      prevInput = firstRead;
      char character = decodeInput(firstRead);
      Keyboard.release(prevCharacter);
      prevCharacter = character;
      if (character != 0) {
