     // c2 is size 0-100 if vertical, 101-201 if horizontal
     rainbow = settings.c1 > 100;
     horizontal = settings.c2 > 100;
-    dimension = horizontal ? WIDTH : HEIGHT;
+    dimension = horizontal ? width : height;
     speed = float(int(rainbow ? settings.c1 - 101 : settings.c1) - 50) / 1000.0;
     // First convert size to [0,100]
     size = horizontal ? settings.c2 - 101 : settings.c2;
     if (rainbow) {
       // "size" isn't really true here
-      size = (size / 100.0 * 256.0 / dimension * 2.0);
-    } else {
-      size = dimension * (size / 280.0 + 0.15);
-    }
-
-    /*
-    Serial.print("movementInit: ");
-    Serial.print(rainbow);
-    Serial.print(',');
-    Serial.print(horizontal);
-    Serial.print(',');
-    Serial.print(dimension);
-    Serial.print(',');
-    Serial.print(speed, 5);
-    Serial.print(',');
-    Serial.println(size);*/
+      //size = (size / 100.0 * 256.0 / dimension * 2.0);
+      size = mapRange(size, 0, 100, 1, 256.0 / dimension * 2.0);
+    } else {
+      size = mapRange(size, 0, 100, 2, dimension - 2);
+    }
   } else {
     float frameTime = millis() - lastFrame;
     position += speed * frameTime;

    runMovement(true);
  } else {
    Serial.print("Unknown mode: ");
    Serial.println(char(settings.mode));
  }
}


  checkSave();
}


void setAt(byte x, byte y, CRGB color) {
  if (STAGGERED) {
    
  } else {
    if (x + y * width < NUM_LEDS) {
      leds[x + y * width] = color;
    }
  }
}
void fillRow(byte row, CRGB color) {
  if (STAGGERED) {
    byte start = row * width / 2;
    byte num = width / 2;
    if (row % 2) {
      start += 1;
    } else {
      num += 1;
    }
    if (start + num > NUM_LEDS) {
      Serial.print("DANGER: ");
      Serial.print(row);
      Serial.print(',');
      Serial.print(start);
      Serial.print(',');
      Serial.println(num);
      return;
    }
    fill_solid(leds + start, num, color);
  } else {
    for (byte j = 0; j < width; j++) {
      if (row * width + j < NUM_LEDS) {
        leds[row * width + j] = color; 
      }
    }
  }
}
void fillCol(byte col, CRGB color) {
  if (STAGGERED) {
    for (byte i = col / 2 + (col % 2) * (BASE_WIDTH + 1);
         i < NUM_LEDS; i += width) {
      leds[i] = color;
    }
  } else {
    for (byte j = col; j < NUM_LEDS; j+= width) {
      leds[j] = color;
    }
  }
}

void sendSeparately(byte* buf, int len) {
  // Flush any existing sending,
  Serial.flush();
