 		}
 
 		// record the previous state
-		lastPeriodX = periodX;
-		lastPeriodY = periodY;
+		//lastPeriodX = periodX;
+		//lastPeriodY = periodY;
 		signals[i] = inRange(periodX, periodY);
 		i++;
 

				elapsedTime = calculateTime(startTime);

				// Any valid accumulated time will be returned
				if (pulseCount > minCount) {
          			return elapsedTime;
				}
				else {

				if (startTime == 0) {
					startTime = millis();
				}
				pulseCount += 1;
			}
		}
		// if periodX and periodY IS NOT a valid pair
