 			// so, if lastPeriodX and lastPeriodY WAS a valid pair
 			/*if ( inRange(lastPeriodX, lastPeriodY) ) {
 				// check if the job was more than 5 seconds
-				if (pulseCount > minCount) {
+				if (pulseCount > freeTime) {
 					// calculate elapsed time in seconds
 					return calculateTime(startTime);
 				}

	// some constants
	const int pollTimeout = 5;
	const int pollInterval = 900;
	const int minCount = 5;
	// some variables used in this scope
	unsigned char serialNumber[bufferSizeSNR];
	unsigned long startTime, elapsedTime = 0;

				elapsedTime = calculateTime(startTime);

				// Any valid accumulated time will be returned
				if (startTime > 0 && elapsedTime > freeTime) {
          			return elapsedTime;
				}
				else {
