 }
 
 /* crossFade() converts the percentage colors to a 
-*  0-255 range, then loops 1020 times, checking to see if  
+*  0-255 range, then loops 256 times, checking to see if  
 *  the value needs to be updated each time, then writing
 *  the color values to the correct pins.
 */

int calculateStep(int prevValue, int endValue) {
  int step = endValue - prevValue; // What's the overall gap?
  if (step) {                      // If its non-zero, 
    step = 1020/step;              //   divide by 1020
  } 
  return step;
}

*  (R, G, and B are each calculated separately.)
*/

int calculateVal(int step, int val, int i, int limit) {

  if ((step) && i % step == 0) { // If step is non-zero and its time to change a value,
    if (step > 0 && val < limit) {              //   increment the value if step is positive...
      val += 1;           
    } 
    else if (step < 0 && val > limit) {         //   ...or decrement it if step is negative
      val -= 1;
    } 
  }
