   p1.X = maxX / 2;
   p1.Y = (maxY / 2) + 10;
   GenerateFood();
+  score = 0;
+  arrayPosition = 0;
+  p1.Len = 1;
+  for (int i=0; i < p1.MaxLength; i++){
+    p1.Moves[i].Active = false;
+  }
+
+  
+  gameRunning = true;
 }
 
 void LogMove()
 {
-  if(p1.Moves[arrayPosition] == NULL)
-  {
-      p1.Moves[arrayPosition] = new Coords();
-    
-  }
-      p1.Moves[arrayPosition]->X = p1.X;
-      p1.Moves[arrayPosition]->Y = p1.Y;
+  p1.Moves[arrayPosition].Y = p1.Y;
+
+  if(p1.Moves[arrayPosition].Active == false)
+  {
+      p1.Moves[arrayPosition].Active = true;    
+  }
+      p1.Moves[arrayPosition].X = p1.X;
+      p1.Moves[arrayPosition].Y = p1.Y;
 
   if(arrayPosition < p1.Len -1)
   {

byte minY = 10;
bool gameRunning = true;

class coords
{
  public:
  byte X = 0;
  byte Y = 0; 
};

typedef struct coords Coords;

Coords foodLocation;
Coords previousPosition;


int score = 0;
int arrayPosition = 0;

