           card.credits = 0;
         } else { // Known card
           // Fetch current credits
-          uint16_t four = 4;
-          uint16_t credit_addr = addr+4;
-          //Serial.print("Z ");
-          Serial.println(addr,DEC);
-          Serial.println(addr+4,DEC);
-          Serial.println(addr+four,DEC);
-          //Serial.print(" + ");
-          //Serial.print(CARD_UID_SIZE);
-          //Serial.print(" = ");
-          Serial.println(credit_addr);
-          credit_addr = addr+four;
-          Serial.println(credit_addr);
-          EEPROM_readAnything(credit_addr,card.credits);
+          EEPROM_readAnything(addr+sizeof(card_uid_t),card.credits);
         }
         card.credits += credits_in_machine;
         // Card found! (Known card OR found free spot for new card)

#include "VendingMachineRFID.h"

/* Hack to fix sizeof(card_uid_t) sometimes becoming 5 (?) */
#define CARD_UID_SIZE 4

MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
uint32_t lastCardScan; // Debounce RFID reads
uint32_t timeBetweenScans;

void setup() {
  uint32_t lastCardScan = 0;

        } else { // Known card!
          // Card found!
          // Withdraw from card
          EEPROM_readAnything(addr+sizeof(card_uid_t),card.credits);
          if(card.credits == 0){
            // ERR Beep + display "NO CREDITS"?
            Serial.println("NO CREDITS - KNOWN CARD");
