 #include <Adafruit_NeoPixel.h>
 #include <ledtable.h>
 
+/*
+ * SNES Controls for Tetris
+ * 
+ * A:         put the block down at this column
+ * START:     start a new round, whole game resets all stats except the sessionHighscore, also shows the highscore and your final score
+ * SELECT:    pauses the game
+ * UP:        turn the block used at the moment
+ * RIGHT:     put the block one pixel to the right
+ * LEFT:      put the block one pixel to the left
+ * DOWN:      put the pixel one block down
+ * 
+ */
+
+
+
+// Ports for SNES Controller
 #define clock 2
 #define strobe 3
 #define data 4
+
+// Size and pin for the LEDTable
 #define sizeX 20
 #define sizeY 10
 #define LEDTABLE_PIN 6
 
+// Global data storage for the block used at the moment and the next block
 byte mThisBlock;
 byte mNextBlock;
+
+// Rotation used at the moment (initializes at 0 every game)
 short mRotation = 0;
+
+// Start position of blocks (initializes at 0 | 5 every game)
 short mPosX = 0;
 short mPosY = 5;
 
+// Level management (cycles are the number of blocks fallen, counter is the variable of how many frames are gone since last reset to limit)
 byte cycles = 0;
+int counter = 0;
+
+// Level management. These can be changed in order to make levels easier or harder:
+  // limit - the base number of frames until a block falls used at level 1 (Default 30)
+  // maxCycles - the number of blocks that have to fall until the level gets up (Default 10)
+  // difficulty - the number of frames until a block falls used at maximum level (Default 10)
+  // difficultyHardening - the reduction in number of frames until a block falls when cycles reaches maxCycles (Default 5)
 byte limit = 30;
+byte baseLimit = limit;
+byte maxCycles = 10;
+byte difficulty = 10;
+byte difficultyHardening = 5;
+
+// ID of the block used at the moment, never resets, only if it overflows, is just for comparison with the previous block
 short blockCounter = 0;
 
+// Point counter (resets at Reset, if points are added when a block manifests it will be sent to Serial Write). Higher levels as well as deleting multiple rows at once will result in getting more points.
 short pointCounter = 0;
 int pointsThisRound = 0;
 int linesThisRound = 0;
 
+int sessionHighscore = 0;
+
+// Game states, when gameOver is activated it will reset at restart, pause whill reset at pressing SELECT (is a bit buggy atm)
 boolean gameOver = false;
 boolean pause = false;
 
+// The LEDTable to show the game
 LEDTable ledtable = LEDTable(LEDTABLE_PIN, 20, 10, PIXELORDER<snake>);
 
+// Initialization of the Controller
 Snes controller(clock, strobe, data);
-int counter = 0;
-
+
+// The array containing the color of the pixel placed in it.
 short fieldmap[sizeX][sizeY];
 
+// Array of Colors (RGB mapped to the block type).
 static const short colors[7][3] = 
 {
   {

  mNextBlock = random(7);
  showBlock();
  blockCounter++;
  if (fieldmap[mPosX][mPosY] != -1) {
    gameOver = true;
  }
}
/* 
 * ===========================================
 *  SNES-Controller Commands

 * ===========================
 */

// Check if there are lines that are to clear, if there are: clear them and show the new score
 void clearLines() {

  boolean lLineClear = true;
