   uint32_t nightSteps = 0;
   uint32_t stepsToInit = 0;
   
-  if (getSunRiseSet(lat, lon, daySteps, nightSteps, stepsToInit))
-  {
-    Serial.print("daySteps ");
-    Serial.println(daySteps);
-    Serial.print("nightSteps ");
-    Serial.println(nightSteps);
-    Serial.print("stepsToInit ");
-    Serial.println(stepsToInit);
-  }
-  else
-  {
-    Serial.println("Failed to get times");
-  }  
-  
-  Serial.println("Setup complete");
-  
-
+  do {
+    Serial.println("Calling getSunRiseSet()");
+    getSunRiseSet(lat, lon, daySteps, nightSteps, stepsToInit);
+  } while (daySteps == 0 && nightSteps == 0);
+    
+ 
+  Serial.print("\ndaySteps ");
+  Serial.println(daySteps);
+  Serial.print("nightSteps ");
+  Serial.println(nightSteps);
+  Serial.print("stepsToInit ");
+  Serial.println(stepsToInit); 
+  
+  Serial.println("Loop Setup complete");
   delay(2000);
   
   steps_current_time = stepsToInit;
     //make needle turn fast to the right time 
-  while(i < stepsToInit){
-    
+  while (i < stepsToInit) {
     step1(delaylegnth_speed);
     step2(delaylegnth_speed);
     step3(delaylegnth_speed);

  if (!root.success()) 
  {
    Serial.println("parseObject() failed");
    return false;
  }

  daySteps = root["daySteps"];
  nightSteps = root["nightSteps"];
  stepsToInit = root["stepsToInit"];
  
  daySteps = daySteps;
  nightSteps = nightSteps;
  
  // Success
  return true;
}

//delay between steps
boolean waitTime(unsigned long time)
{
  
  //Serial.println("time day one is being called:");
  //Serial.println(start_time);
  //Serial.println("Starttime + delay_day_1 is:");
  //Serial.println(start_time + daySteps);
  while ((start_time + time) > millis())
  {
    delay(5);
  }
  

    Serial.println("delay is: " + String(delayMilliseconds));
    delay(delayMilliseconds);
    i++;
  } 
}

void step2 (int delayMilliseconds) {
  if (i < steps_current_time) {
    digitalWrite(9, HIGH);  //DISABLE CH A
    digitalWrite(8, LOW); //ENABLE CH B
  
