     interrupts();
 
     char keypress;
-    while (head != tail && (keypress = dequeue_key()) != '\0')
+    while ((keypress = dequeue_key()) != '\0')
         action_function(keypress);
 }
 


    for (uint8_t i = 0; i != KEYPAD_NUM_ROWS_COLS ; i++) {
        digitalWrite(KEYPAD_COL_PIN_BASE + i, LOW);
        for (uint8_t j = 0; j != KEYPAD_NUM_ROWS_COLS ; j++)
            if (!digitalRead(KEYPAD_ROW_PIN_BASE + j))
                // TODO Handle multibutton presses
                queue_key(buttons[i][j]);
        digitalWrite(KEYPAD_COL_PIN_BASE + i, HIGH);
    }


    for (uint8_t i = 0; i != KEYPAD_NUM_ROWS_COLS ; i++) {
        pinMode(KEYPAD_COL_PIN_BASE + i, OUTPUT);
        digitalWrite(KEYPAD_COL_PIN_BASE + i, LOW);
        pinMode(KEYPAD_ROW_PIN_BASE + i, INPUT_PULLUP);
        attachInterrupt(INTERRUPT_BASE + i, handle_interrupt, CHANGE);
    }
}

