   }
 }
 
-void sleep(unsigned int minTime, unsigned int maxTime){
+void sleep(unsigned long minTime, unsigned long maxTime){
   unsigned int delayVal = random(minTime, maxTime);
   laser.fire(0);
   panTilt.detach();
   unsigned long startTime = millis();
-  for(unsigned int i = 0; i < delayVal; i++){
-    while(millis() - startTime < 60000){
-      heartBeat();
+  for(unsigned long i = 0; i < delayVal; i++){
+    while(millis() - startTime < 1000){
+      heartBeat(millis());
       delay(10000);
       if(startTime > millis()){ //check for rollovers
         startTime = millis();

  }

  else if(random(100001) < 10){
    sleep(30, 40);
  }

  laser.fire(1);

int getDeltaPosition(panTiltPos_t *pt, int funcChangeVal, int changeProb){
  int tempVal = getMarkovDirection(pt, changeProb);

  tempVal *= funcChangeVal;

  return tempVal;

