         {
         if(p1.Moves[i].X == p1.X && p1.Moves[i].Y == p1.Y)
         {
-          gameRunning = false;
+          EndGame();
         }
       }
   }


  if(p1.X >= maxX || p1.X <= minX || p1.Y >= maxY || p1.Y <= minY)
  {
    gameRunning = false; 
  }

  //Check if hit tail

    {
      p1.Len += 1;
    }
    arduboy.tunes.tone(987, 160);
    score += 1;
    LogMove();
    GenerateFood();
