 
         moveJoints(2, stepDown);
 
-        stop = true;
+        if (random(2))
+        {
+            turnLeft();
+        }
+        else
+        {
+            turnRight();
+        }
+
+        startStepFoward();
+
         return;
     }
 }
 
-void setup() {
+
+void setup()
+{
     pinMode(SR04_TRIGGER_PIN, OUTPUT);
     pinMode(SR04_ECHO_PIN, INPUT);
+
+    randomSeed(analogRead(RANDOM_SEED_PIN));
     
     rightAnkle.init();
     leftAnkle.init();

#define LEFT_HIP_PIN            2
#define SR04_TRIGGER_PIN        8
#define SR04_ECHO_PIN           9

#define DELAY 2
#define STOP_DISTANCE           10

struct Joint
{

Joint leftHip(LEFT_HIP_PIN, LEFT_HIP_POS_MIN, LEFT_HIP_POS_MIDDLE, LEFT_HIP_POS_MAX);

bool started = false;

long getDistance()
{
