 		// if periodX and periodY IS NOT a valid pair
 		if ( !inRange(periodX, periodY) ) {
 			// check if enough negative signals have been detected
+			// calculate elapsed time
 			if (checkHistory(signals) == flag.detectedJobEnd) {
 				elapsedTime = calculateTime(startTime);
 
-				// check if a job was detected and return the time
+				// if a job was detected, return
 				if (startTime > 0 && elapsedTime > freeTime) {
 					return elapsedTime;
 				}

		return false;
	}
}

/*
	Calculate time elapsed in seconds.
*/
unsigned long calculateTime(unsigned long startTime) {
	return (millis() - startTime)/1000;
}

void soundFeedback(bool isReject) {
	if (isReject) {
		tone(speakerPin, rejectNote, rejectDuration);

	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.
*/
bool inRange(unsigned long periodX, unsigned long periodY) {
	const int upperBound = 6;
