    while (round(pos) < 0) pos += 21.0;
    while (round(pos) > 20) pos -= 21.0;
 
-   // Now re-compute the display
+   CRGB color = selectColor(heading);
+
+
+   int lightOn[round(halfWidth*2 + 1)] = {0,1,2,3};
+   int lightIndex = 0;
+   for(int i = pos;i>pos-halfWidth;i--) {
+     lightOn[lightIndex] = wrapAround(i);
+     lightIndex++;
+   }
+   for(int i=pos;i<pos+halfWidth;i++) {
+     lightOn[lightIndex] = wrapAround(i);
+     lightIndex++;
+   }
    for (int i = 0; i <21; i++) {
-      // Compute the distance bewteen the pixel and the center
-      // point of the virtual pendulum.
-      float diff = i - pos;
-
-      // Light up nearby pixels proportional to their proximity to 'pos'
-      if (fabs(diff) <= halfWidth) {
-         CRGB color;
-         float proximity = halfWidth - fabs(diff) * 200; //Not being used right now
-
-         // pick a color based on heading & proximity to 'pos'
-         color = selectColor(heading);
-         
-         // do both eyes
-         leftLense[i] = color;
-         float rightLenseOffset = i - 10;
-         while (round(rightLenseOffset) < 0) rightLenseOffset += 21.0;
-         while (round(rightLenseOffset) > 20) rightLenseOffset -= 21.0;
-         int rightLenseIndex = fabs(rightLenseOffset);
-         if (mirroredEyes) {
-           rightLense[rightLenseIndex] = color;
-         } else {
-           rightLense[rightLenseIndex] = color;
-         }
-      } else {// all others are off
-         float rightLenseOffset = i - 10;
-         while (round(rightLenseOffset) < 0) rightLenseOffset += 21.0;
-         while (round(rightLenseOffset) > 20) rightLenseOffset -= 21.0;
-         int rightLenseIndex = fabs(rightLenseOffset);
-         leftLense[i] = CRGB(0,0,0);
-         if (mirroredEyes) {
-           rightLense[rightLenseIndex] = CRGB(0,0,0);
-         } else {
-           rightLense[rightLenseIndex] = CRGB(0,0,0);
-         }
+      int rightIndex = i;
+      int leftIndex = wrapAround(i - 10); // This is because the strips aren't installed in the same place
+      boolean turnedOn = false;
+      for(int j=0;j<(halfWidth*2+1);j++) {
+        if(lightOn[j] == i){
+          leftLense[leftIndex] = color;
+          rightLense[rightIndex] = color;
+          turnedOn = true;
+        }
       }
+      if(turnedOn == false){
+        leftLense[leftIndex] = CRGB(0,0,0);
+        rightLense[rightIndex] = CRGB(0,0,0);
+      }
    }
    FastLED.show();
+}
+
+int wrapAround(int value) {
+  if(value < 0) {
+    return value + 21;
+  }
+  if(value > 20) {
+    return value - 21;
+  }
+  return value;
 }
 
 // choose a color based on the compass heading and proximity to "pos".

   // Calculate the angle of the vector z,x from magnetic North
//   float heading = atan2(mag.magnetic.x,mag.magnetic.z) * (180 / Pi);
    float heading = orientation.heading;

   // Normalize to 0-360 for a compass heading
   if (heading < 0) {
      heading = 360 + heading;


// Tuning constants. (a.k.a. "Fudge Factors)  
// These can be tweaked to adjust the liveliness and sensitivity of the eyes.
const float friction = 0.985; // frictional damping constant.  1.0 is no friction.
const float swing = 20;  // arbitrary divisor for gravitational force
const float gravity = 100;  // arbitrary divisor for lateral acceleration
const float nod = 7.5; // accelerometer threshold for toggling modes

long nodStart = 0;
long nodTime = 2000;

bool antiGravity = false;  // The pendulum will anti-gravitate to the top.
bool mirroredEyes = false; // The left eye will mirror the right.

const float halfWidth = 2; // half-width of pupil (in pixels)

// Pi for calculations - not the raspberry type :: 1.25
const float Pi = 3.14159;
