 
 void refresh()
 {
+  button1State = digitalRead(button1Pin);
+  button2State = digitalRead(button2Pin);
+  if(button1State == HIGH) button1 = 1;
+  if(button2State == HIGH) button2 = 1;
   for(int i=0;i<40;i++)
   {
     strip.setPixelColor(i,pixels[i].getColor());

  strip.begin();
  strip.show();
  setArray();
}

void loop() {
  // put your main code here, to run repeatedly:
  
  
  
  for(int i=0;i<200;i++){
    strobe();
  }
  for(int j=0;j<3;j++){
    pulseLeds();
  }
  
  inOrderCycle();
  
  
  cubeCycle();
  
  
  
  for(int k=0;k<3;k++){
    cubeVertPlaneShift();
  }
  
  
  for(int l=0;l<3;l++){
    cubeHorizPlaneShift();
  }
  
  
  snake(500);
  
}



      currentZ = proposedZ;   
      
      changePix(cube[currentX][currentY][currentZ], 1, 250);
      changePix(cube[previousX1][previousY1][previousZ1], 2, 200);
      changePix(cube[previousX2][previousY2][previousZ2], 3, 125);
      changePix(cube[previousX3][previousY3][previousZ3], 4, 30);
      
      refresh();
      delay(1);
      
    } else {
      proposedX = currentX;
