 double stepperXdestPosition = 0;
 double stepperXtimer = 0;
 int    stepperXtoggle = 0;
-double stepperXspeed = 110;
+double stepperXspeed = 3200;
 
 int motorpinYstep = 26;
 int motorpinYdir  = 27;

    stepperEcurrPosition = 0;
    stepperEdestPosition = 0;
    laste = 0;
    Serial.print("{ \"log\" : \"Extruder stepper axis zero success\"}");  
    
}
// END ZEROAXIS()
// ==============================================================================================================================================================================
// START LINE()
void line(double x, double y, double z, double e) {

  //DISTANCESTEPS
   double distance = sqrt( pow((float)(x - lastx),2) + pow( (float)(y - lasty),2) + pow( (float)(z - lastz), 2) + pow( (float)(e - laste), 2));
   double steps = round(distance*500);
   
        //calculate new step positions from micron position
   double nx = tablexsteps*(x/tablexdistance);
   double ny = tableysteps*(y/tableydistance);  
   double nz = tablezsteps*(z/tablezdistance);      
   double ne = tableesteps*(e/tableedistance);                

   double cx = float(stepperXcurrPosition);
   double cy = float(stepperYcurrPosition);   
   double cz = float(stepperZcurrPosition);      
   double ce = float(stepperEcurrPosition);         

  
   double dx = ((nx-cx)/steps);
   double dy = ((ny-cy)/steps);   
   double dz = ((nz-cz)/steps);      
   double de = ((ne-ce)/steps);         

   
   //distance
   /*
   double deltax = lastx - x;
   double deltay = lasty - y;
   double deltaz = lastz - z;
   double deltae = laste - e;   
   Serial.print("{ \"deltax\" : \"");
   Serial.print(deltax);
   Serial.print("\", \"deltay\" : \"");   
   Serial.print(deltay);   
   Serial.print("\", \"deltaz\" : \"");   
   Serial.print(deltaz);   
   Serial.print("\", \"deltae\" : \"");   
   Serial.print(deltae);      
   Serial.println("\"}");
   */
   //
  
   lastx = x;
   lasty = y;
   lastz = z;
   laste = e;
    
   for (int i = 0; i <= steps; i++) {   
     double newx = cx + (dx*i);
     double newy = cy + (dy*i);     
     double newz = cz + (dz*i);          
     double newe = ce + (de*i);     
      
     stepperXdestPosition = round(newx);
     stepperYdestPosition = round(newy);
     stepperZdestPosition = round(newz);
     stepperEdestPosition = round(newe);     
     
     
     while ((stepperXdistanceToGo() != 0) || (stepperYdistanceToGo() != 0) || (stepperZdistanceToGo() != 0) || (stepperEdistanceToGo() != 0)) {
       ///GET THESE INTO THE MAIN LOOP
       // NEED TO REFACTOR EVENT LOOP
       
         stepperXrun();
         stepperYrun();
         stepperZrun();
         stepperErun();
       
       
       } 
   }
  
}
// END LINE();

        aJson.deleteItem(msg);                

        tempcounter++;
        if (tempcounter > 15) {
            thermistor();
            tempcounter = 0;
        }
