 #include <SPI.h>
 #include "MFRC522.h"
 
+#include <Servo.h>
+
 #define RST_PIN	        9		
-#define SS_PIN		10	
+#define SS_PIN		      10	
+#define servopin        6
+
+#define mouth_open_pos    120
+#define mouth_closed_pos  40
 
 MFRC522 mfrc522(SS_PIN, RST_PIN);	// Create MFRC522 instance
 MFRC522::MIFARE_Key key;
 byte cardUID;
 
+Servo mouthservo; //our servo
+int servo_pos = 0; //var to store servo position
 
 unsigned char fuse[1024];
-void setup(){
-Serial.begin(9600);
-SPI.begin();
-mfrc522.PCD_Init();
-  
-
-    for (byte i = 0; i < 6; i++) {
-        key.keyByte[i] = 0xFF;
-    }
+
+void setup(){ //////////////SETUP////////////////////////
+  Serial.begin(9600);
+  mouthservo.attach(servopin);
+  SPI.begin();
+  mfrc522.PCD_Init();
+  for (byte i = 0; i < 6; i++) {
+    key.keyByte[i] = 0xFF;
+  }
     
-readloop(100);
-   LCDA.initDriverPin(2,3,4); 
+  readloop(100);
+  LCDA.initDriverPin(2,3,4); 
   LCDA.Initialise(); // INIT SCREEN  
 
+  openMouth();
+
   //Serial.println(F("boot completed"));
 }
-unsigned char* fuse3(const unsigned char* a ,const unsigned char* b,const unsigned char* c){
-  
+
+void openMouth(){ //open the mouth
+  mouthservo.write(mouth_open_pos);
+}
+
+void closeMouth(){ //close the mouth
+  mouthservo.write(mouth_closed_pos);
+}
+
+
+/*unsigned char* fuse3(const unsigned char* a ,const unsigned char* b,const unsigned char* c){ /////////////////////////////////// IS THIS OBSOLETE? /////////
  unsigned char* fused =(unsigned char*)malloc(sizeof(char)*1024);
-  int i=0;
-  int ac=0;//a counter 
-  int bc=0; //b counter 
-  int cc=0;//c counter 
-
-
-  for(int n=0;n<64;n++){
-    for(int k=0;k<5;k++){
-      memcpy_P(&fused[i],&a[ac],sizeof(char)*5);
-      ac++;
-       i++;
-    }
-
-        for(int k=0;k<5;k++){
+ int i=0;
+ int ac=0;//a counter 
+ int bc=0; //b counter 
+ int cc=0;//c counter 
+
+ for(int n=0;n<64;n++){
+   for(int k=0;k<5;k++){
+     memcpy_P(&fused[i],&a[ac],sizeof(char)*5);
+     ac++;
+      i++;
+   }
+
+     for(int k=0;k<5;k++){
       memcpy_P(&fused[i],&b[bc],sizeof(char)*5);
       bc++;
-       i++;
-    }
-        for(int k=0;k<5;k++){
+      i++;
+     }
+     for(int k=0;k<5;k++){
       memcpy_P(&fused[i],&c[cc],sizeof(char)*5);
       cc++;
-       i++;
-    }
+      i++;
+     }
     fused[i]=0x00;
     i++;
   }
-
   return fused;
-}
-const unsigned char* getMatch(int input){
+}*/
+
+const unsigned char* getMatch(int input){ //getmatch function
  if(input>0||input<13){
   return index[input];
- }
-  
-   return index[0];
-}
+ }  
+ return index[0];
+}
+
+
 void displayfuse(int firstnumber, int operation , int secondnumber ){
  LCDA.CLEAR();
-   readloop(100);
+ readloop(100);
 
  const unsigned char* a = getMatch(firstnumber);
  const unsigned char* b = getMatch(operation);


***********************************************/

#include "LCD12864RSPI.h"
#include "DFrobot_bmp.h"
#include "DFrobot_char.h"

    // Stop encryption on PCD
    mfrc522.PCD_StopCrypto1();
}


void dump_byte_array(byte *buffer, byte bufferSize) { //dump byte array function
    for (byte i = 0; i < bufferSize; i++) {
        Serial.print(buffer[i] < 0x10 ? " 0" : " ");
        Serial.print(buffer[i], HEX);
