       while(Serial.available()){Serial.read();}
       // Fetch current credit count for the vending machine, in order to know whether to withdraw or deposit
       Serial.print("C");
+      credits_in_machine = rfid_recieve();
       //Serial.println(addr);
       // Attempt to recieve response from vending machine
       // If no response from has been recieved within a second, assume it is not powered/booted yet, stop processing
+      if(recieve_error == 1) return;
+      /*
       if(Serial.readBytes(parseBuffer, sizeof(parseBuffer)) != 2){
         //Serial.print("No response - aborting.");
         return;
       }
       //Serial.println(parseBuffer[0],DEC);
       //Serial.println(parseBuffer[1],DEC);
-      memcpy(&credits_in_machine,parseBuffer,sizeof(parseBuffer));
+      memcpy(&credits_in_machine,parseBuffer,sizeof(parseBuffer));*/
       // Zero credits in machine - done now to avoid race-conditions of people buying when saving credits
-      Serial.print("Z");
+      Serial.print("ZZZZZ"); // Zero five times
       //Serial.println(credits_in_machine);
 
       if(credits_in_machine == 0){ // Attempt withdrawal               ## WITHDRAW
         if(addr == 65535){ // New card!
           // ERR Beep + display "NO CREDITS"?
           //Serial.println("NO CREDITS - UNKNOWN CARD");
-          Serial.println("N");
+          Serial.print("N");
           // Halt PICC
           mfrc522.PICC_HaltA();
           // Return

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

uint16_t credits_in_machine;//Serial.parseInt();
char parseBuffer[2];

void setup() {
  lastCardScan = 0;
  timeBetweenScans = 1500; // TODO: Set to 1500 when in production
  Serial.begin(9600); // Initialize serial communications with master vending arduino
  SPI.begin(); // Init SPI bus
  mfrc522.PCD_Init(); // Init MFRC522 card
}

void loop() {
  // Look for new cards
  if(!mfrc522.PICC_IsNewCardPresent()) {return;}
  // Select one of the cards
  if(!mfrc522.PICC_ReadCardSerial()) {return;}
  // Now a card is selected. The UID and SAK is in mfrc522.uid.

  // Dump UID

            // Check if card has been changed
            // OK Beep + Set credits on vending machine
            Serial.print("S");
            char error = rfid_transmit(current_credits);
            if(error != 0){
              // Could not update machine credits - attempt to save credits to card again!
              card.credits = current_credits;
              updateAndVerify(addr,card);
            }
          } else {
            // ERR Beep + display "ERR  EEPROM BAD" ?
            //Serial.println("ERR  EEPROM BAD");
            Serial.print("B");
            // Halt PICC
            mfrc522.PICC_HaltA();
            // Return
