 		return flag.idle;
 	}
 }
-/*
-	Determines if the driver signals are valid. During a job,
-	the period of a pulse is either 0, 5 or 6 microseconds.
-	There are slight deviations at times, so summing the values together
-	and using the maximum possible sum as a check is a reliable way to
-	determine if a signal is valid.
-
-int inRange(unsigned long periodX, unsigned long periodY) {
-	unsigned int sum = periodX + periodY;
-
-	if (0 < sum && sum <= maximumValue) {
-		return 1;
-	}
-	else {
-		return 0;
-	}
-}
-*/
-/*
-	Calculate time elapsed in seconds.
-
-unsigned long calculateTime(unsigned long startTime) {
-	return (millis() - startTime)/1000;
-}
-*/
-/*
-	This will play 3 rapid notes or 1 long note.
-*/
 /*void soundFeedback(bool isReject) {
 	if (isReject) {
 		tone(speakerPin, rejectNote, rejectDuration);

				if (startTime == 0) {
					startTime = millis();
				}
				// track number of valid pulses (after job start)
				pulseCount += 1;
			}
		}
		// if periodX and periodY IS NOT a valid pair

	// some variables used in this scope
	unsigned long startTime = 0;
	unsigned int periodX, periodY;
	unsigned int pollCounter = 0;
	int signals[] = { 0, 0, 0, 0, 0 };
  	int i = 0;
  	int numValid, numInvalid = 0;

	// Only here temporarily for debugging
	if (1) {
		Serial.print(startTime); Serial.print(" "); Serial.print(elapsedTime); Serial.print(" ");
	}
 
	while (1) {
