 				soundFeedback(reject);
 				Serial.print(messages.cancel);
 				sendCount = (millis() - startTime)/1000;
-				while(1) {
-					if (sendCount > minCount) {
-						Serial.println(sendCount);
-					}
-          else {
-            Serial.println(0);
-          }
+				if (sendCount > minCount) {
+          return sendCount;
 				}
-				return sendCount;
+        else {
+				  return 0;
+        }
 			}
 		}
 		else {

		// record the previous state
		lastPeriodX = periodX;
		lastPeriodY = periodY;
		delay(pollInterval);
	}
}

					// calculate elapsed time and push to ThingSpeak log
					sendCount = (millis() - startTime)/1000;
					Serial.print("Sending... Time: ");
					Serial.println(sendCount);
					// Make sure logs are properly spaced out
					if ( (millis() - lastSend) < sendInterval) {
						delay(sendInterval);
