       }
       else
       {
-        tailPosition = 0;
+        tailPosition = p1.Len -1;
       }
    } 
+}
+
+void DrawFrame()
+{
+  arduboy.drawRect(minX,minY, maxX, maxY, WHITE);
 }
 
 // This function runs once in your game.

  // first we clear our screen to black
  arduboy.clear();

  CollisionDetection();

  if(arduboy.pressed(RIGHT_BUTTON)) {


  // here we set the framerate to 15, we do not need to run at
  // default 60 and it saves us battery life
  arduboy.setFrameRate(10);

 StartGame(); 
}
