   return true;
 }
 
+int toPositive(int num){
+  if(num < 0) return num*(-1);
+  else return num;
+}
+
 bool equalsBuffer(int start, int end, char* str){ return equals(buf, start, end, str, String(str).length()); }
 
 int getInt(char* str, int pos){
-  String amount = String(str).substring(pos+1,pos+6);
-  return amount.toInt();
+  if(equals(str, pos+1, pos+7, "RANDOM", 6)){
+    return random(rMin, rMax);
+  }else{
+    return String(str).substring(pos+1,pos+6).toInt();
+  }
 }
 
 void KeyboardWrite(uint8_t c){  

    else if(equalsBuffer(0,space,"STRING")){
      for(int i=space+1;i<bufSize;i++) KeyboardWrite(buf[i]);
    }
    else if(equalsBuffer(0,space,"REM") || equalsBuffer(0,space,"REPEAT")){}
    else{
      runCommand(0,space);

  else if(equalsBuffer(s,e,"NUM_PERIOD")) KeyboardWrite(KEYPAD_PERIOD);
  else if(equalsBuffer(s,e,"NUM_PLUS")) KeyboardWrite(KEYPAD_PLUS);

  else if(equalsBuffer(s,e,"CLICK") || equalsBuffer(s,e,"CLICK_LEFT")) Mouse.click();
  else if(equalsBuffer(s,e,"CLICK_RIGHT")) Mouse.click(MOUSE_RIGHT);
  else if(equalsBuffer(s,e,"CLICK_MIDDLE")) Mouse.click(MOUSE_MIDDLE);
  
  else if(equalsBuffer(s,e,"PRESS") || equalsBuffer(s,e,"PRESS_LEFT")) Mouse.press();
  else if(equalsBuffer(s,e,"PRESS_LEFT")) Mouse.press(MOUSE_RIGHT);
  else if(equalsBuffer(s,e,"PRESS_MIDDLE")) Mouse.press(MOUSE_MIDDLE);
  else if(equalsBuffer(s,e,"RELEASE") || equalsBuffer(s,e,"RELEASE_LEFT")) Mouse.release();
  else if(equalsBuffer(s,e,"RELEASE_LEFT")) Mouse.release(MOUSE_RIGHT);
  else if(equalsBuffer(s,e,"RELEASE_MIDDLE")) Mouse.release(MOUSE_MIDDLE);
  
#ifdef debug
  else Serial.println("failed to find command");
#endif
