   PORTB |= B11111111;
 
   Keyboard.begin();
+  Serial.begin(9600);
 }
 
 char readButtons() {
-  return (~(PINB >> 1)) & B00111111;
+  return (~(PINB)) & B00111111;
 }
 
 void toggleKey(char key) {
-  if (!toggles[key >> 7]) {
-    toggles[key >> 7] = true;
+  if (!toggles[key ^ 80]) {
+    toggles[key ^ 80] = true;
     Keyboard.press(key);
   } else {
-    toggles[key >> 7] = false;
+    toggles[key ^ 80] = false;
     Keyboard.release(key);
   }
 }

      Keyboard.release(prevCharacter);
      prevCharacter = character;
      if (character != 0) {
        Keyboard.press(character);
      }
    }
  }
}


  if (input & 1) {
    switch(input){
      case B000001:
        toggleKey(KEY_LEFT_SHIFT);ute
        return 0;
      case B111101:
        resetState();
