 int moveArmCoord( double radius_mm, double height_mm, double basAngle_d, double handAngle_d )
 {
    if ( radius_mm < 0 ) return -4;
-   DEBUG("moveArmCoord("); DEBUG(radius_mm); DEBUG(","); DEBUG(height_mm); DEBUG(","); DEBUG(basAngle_d); DEBUGln(")");
+   DEBUG("moveArmCoord("); DEBUG(radius_mm); DEBUG(","); DEBUG(height_mm); DEBUG(","); DEBUG(basAngle_d); DEBUG(","); DEBUG(handAngle_d); DEBUGln(")");
    /* Lengths from shoulder to wrist in cylindrical coordinates */
    double s2w_h = height_mm - BASE_HEIGHT - HAND*sin( radians( handAngle_d) );
    double s2w_r = radius_mm - HAND*cos( radians( handAngle_d) );

/*********************************/
/* General system debugging code */
/*********************************/
#define DEBUG // Uncomment line to add debugging code

#ifdef DEBUG
#  define DEBUG(x) (Serial.print(x))
#  define DEBUGln(x) (Serial.println(x))
#else

   /* elbow angle */
   double elbAngle_r = acos(( HUM_SQ + ULN_SQ - s2w ) / ( 2 * HUMERUS * ULNA )); // Angle between humerus and ulna
   /* wrist angle */
   double wriAngle_d = 360 + handAngle_d - degrees(shlAngle_r + elbAngle_r);
   
   return ( s2w_sqrt > HUMERUS + ULNA ) ? -3 : slowMoveArm( basAngle_d, degrees(shlAngle_r), degrees(elbAngle_r), wriAngle_d ); // Return -3 if no solution exists (out of range)
}
