 boolean gameInProgress = false;
 boolean buttonPressed = false;
 
-// Pins for inputs (push buttons) and outputs (shift registers / LEDs)
+// Pins for inputs (push buttons)
 const int UP_PIN = A0;
-const int RIGHT_PIN = 0; // TODO
-const int DOWN_PIN = 0; // TODO
-const int LEFT_PIN = 0; // TODO
-const int FOO = 13; // TODO
-
-const int colorMap[8] = {0, 0, 0, 0, 0, 0, 0, 0}; // TODO
-const int pinMap[4]]4]; // TODO
+const int RIGHT_PIN = A1;
+const int DOWN_PIN = A2;
+const int LEFT_PIN = A3;
+
+// Pins for outputs (shift registers / LEDs)
+const int LATCH_PIN = 8; // green
+const int CLOCK_PIN = 12; // yellow
+const int DATA_PIN = 11; // blue
 
 /* Initializes all connections and creates a new game. */
 void setup() {
     // Initialize serial
     Serial.begin(9600);
 
-    // Initialize inputs and outputs
+    // Initialize inputs (push buttons) and outputs (shift registers and LEDs)
     pinMode(UP_PIN, INPUT);
     pinMode(RIGHT_PIN, INPUT);
     pinMode(DOWN_PIN, INPUT);
     pinMode(LEFT_PIN, INPUT);
-    pinMode(FOO, OUTPUT); // TODO
-
-    // TODO ~ Seed the PRNG with something reasonable
+
+    pinMode(LATCH_PIN, OUTPUT);
+    pinMode(CLOCK_PIN, OUTPUT);
+    pinMode(DATA_PIN, OUTPUT);
+
+    // Seed the PRNG with the read from an unconnected pin
+    randomSeed(analogRead(A4));
 
     // Begin game
     newGame();

    }

    // Read inputs
    int upVal = digitalRead(UP_PIN);
    int rightVal = digitalRead(RIGHT_PIN);
    int downVal = digitalRead(DOWN_PIN);
    int leftVal = digitalRead(LEFT_PIN);

    // Confirm that there was no previous button press (so we don't respond too many times)
    if (!buttonPressed) {
        // Make a move
        if (upVal == HIGH) {
            buttonPressed = true;
            makeMove(UP);
        }
        else if (rightVal == HIGH) {
            buttonPressed = true;
            makeMove(RIGHT);
        }
        else if (downVal == HIGH) {
            buttonPressed = true;
            makeMove(DOWN);
        }
        else if (leftVal == HIGH) {
            buttonPressed = true;
            makeMove(LEFT);
        }


    switch(dir) {
        case UP:
            for (int j = 0; j <= 3; j++) {
                for (int i = 0; i <= 3; i++) {
                    if (i == 0) {
                        continue;
                    }
                    movedAnythingYet = attemptTileMove(i, j, i - 1, j) || movedAnythingYet;
                }
            }
        break;

        case RIGHT:
            for (int i = 0; i <= 3; i++) {
                for (int j = 3; j >= 0; j--) {
                    if (j == 3) {
                        continue;
                    }
                    movedAnythingYet = attemptTileMove(i, j, i, j + 1) || movedAnythingYet;
                }
            }
        break;

        case DOWN:
            for (int j = 0; j <= 3; j++) {
                for (int i = 3; i >= 0; i--) {
                    if (i == 3) {
                        continue;
                    }
                    movedAnythingYet = attemptTileMove(i, j, i + 1, j) || movedAnythingYet;
                }
            }
        break;

        case LEFT:
            for (int i = 0; i <= 3; i++) {
                for (int j = 0; j <= 3; j++) {
                    if (j == 0) {
                        continue;
                    }
                    movedAnythingYet = attemptTileMove(i, j, i, j - 1) || movedAnythingYet;
                }
            }
