 #include <Wire.h>
 #include <Adafruit_NeoPixel.h>
 
-#include <QueueArray.h>
+//#include <QueueArray.h>
 #include <math.h>
 
 #define LIGHT_PIN 15
 #define LIGHT_COUNT 32
 #define G_FORCE 8
-#define DELAY_VALUE 500  // Delay for a period of time (in milliseconds).
-
-typedef struct {
+#define DELAY_VALUE 10  // Delay for a period of time (in milliseconds).
+#define DEBUG false
+
+// ----------- ACCEL AXIS STRUCT ------------
+typedef struct ANode{
   int x;
   int y;
   int z;
+  struct ANode * n;
 } Acceleration;
+
+// ----------- QUEUE ------------
+class AxisQueue
+{
+private:
+  Acceleration * front;                       // pointer to front of Queue
+  Acceleration * rear;                        // pointer to rear of Queue
+                        // current number of items in Queue
+
+
+public:
+  AxisQueue(int amount);                 // create queue with a qs limit
+  ~AxisQueue();
+  void addAxis(Acceleration * axis);
+  int * getAverage(void);
+  void printQueue(void);
+};
+
+AxisQueue::AxisQueue(int amount){
+    Acceleration * tmp;
+  
+    front = NULL;
+    rear = NULL;
+    
+    for(int x = 0; x < amount; x++){
+      tmp = new Acceleration;
+      *tmp = {1,1,1,NULL};
+      tmp->n = front;
+      front = tmp;
+      if (x == 0) rear = front;
+    }
+  
+}
+
+void AxisQueue::addAxis(Acceleration * axis){
+    rear -> n = front;
+    rear = front;
+    front = front -> n;
+    rear -> n = NULL;
+
+    rear->x = axis->x;
+    rear->y = axis->y;
+    rear->z = axis->z;
+}
+
+int * AxisQueue::getAverage(){
+    Acceleration * iter = front;
+    int * avg = new (int[3]){0,0,0};
+    int counter = 0;
+
+    while (iter != NULL){
+          avg[0] += iter->x;
+          avg[1] += iter->y;
+          avg[2] += iter->z;
+          iter = iter->n;
+          counter++;
+    }
+    avg[0] = int(max(min(avg[0]/counter, 255), 0));
+    avg[1] = int(max(min(avg[1]/counter, 255), 0));
+    avg[2] = int(max(min(avg[2]/counter, 255), 0));
+    return avg;
+}
+
+void AxisQueue::printQueue(){
+    Acceleration * iter = front;
+    Serial.println("Queue Status!");
+    while (iter != NULL){
+        Serial.print("X: ");Serial.print(iter->x);Serial.print(" ");
+        Serial.print("Y: ");Serial.print(iter->y);Serial.print(" ");
+        Serial.print("Z: ");Serial.println(iter->z);
+        iter = iter->n;
+    }
+    Serial.println("");
+}
+
+
+// --------------- HueForce ----------------
 
 class HueForce {
 
  public:
   Acceleration*
     axis;
-    
-  QueueArray <Acceleration*> 
-    lightWake;
+  
+  //QueueArray <Acceleration*>
+  AxisQueue * lightWake;
 
   // Constructor: number of LEDs, pin number, LED type
   HueForce(int force, int pixelCount, int lightPin);

  
};

HueForce::HueForce(int force, int pixelCount, int pin) : delta(1), totalBrightness(0){
    modifier = int(255.0 / force);
    lighCount = pixelCount;
    lightPin = pin;

    axis = new Acceleration;
    Serial.print("RUN AXIS1: "); Serial.println((int)axis);

    accel = Adafruit_ADXL345_Unified(12345);
    if(!accel.begin()){

  Adafruit_ADXL345_Unified accel;

  void setLimit(int force);
  
  void mergeResults(void);
  void setAxis(void);
