 {
   int tailPosition = arrayPosition;
   for (int i=0; i < p1.Len; i++){
-      if(p1.Moves[tailPosition] != NULL)
-      {
-         arduboy.drawPixel(p1.Moves[tailPosition]->X, p1.Moves[tailPosition]->Y, 1);
+      if(p1.Moves[tailPosition].Active == true)
+      {
+         arduboy.drawPixel(p1.Moves[tailPosition].X, p1.Moves[tailPosition].Y, 1);
       }
       else
       {
         return;
       }
+
 
       if(tailPosition > 0)
       {

  p1.X = maxX / 2;
  p1.Y = (maxY / 2) + 10;
  GenerateFood();
}

void LogMove()
{
  if(p1.Moves[arrayPosition] == NULL)
  {
      p1.Moves[arrayPosition] = new Coords();
    
  }
      p1.Moves[arrayPosition]->X = p1.X;
      p1.Moves[arrayPosition]->Y = p1.Y;

  if(arrayPosition < p1.Len -1)
  {

Coords foodLocation;
Coords previousPosition;


int score = 0;
int arrayPosition = 0;

