Trouble with Benewake TFmini project

I am having trouble with the programming of a TFmini LIDAR/TOF sensor. I want the program to turn on one of 2 LED’s depending on the distance an obstacle is away from the sensor. This will eventually turn into a 2-lane monitoring sensor for Soap Box Derby racing to tell me which car is in the lead at the midpoint of a race. The idea is that I can mount the sensor unobtrusively on the side of the track and still monitor both lanes. If the sensor sees something in the far lane first it will illuminate one light. If it sees something close than it will illuminate a different light. I have adjusted the sample code for the TFmini found on GitHub to do this but there is a strange problem. If something passes by the sensor, it illuminates the LED several times instead of just once. Meanwhile on the Serial monitor it displays several distances that display in a time frame that match the delays in the program. To me it seems like the sensor is not taking a single distance measurement as the program suggests. To say it differently, when an object QUICKLY passes through the sensors field of view, it seems like the object is passing SLOWLY and illuminates the corresponding LED several times. This is shown in the Serial Monitor as several lower numbers that output over a span of several seconds even though the object has long since passed through the sensors field of view.

Any ideas on why this isn’t working? Thanks for your time.

#include <TFMini.h>
#include <SoftwareSerial.h>

SoftwareSerial mySerial (10,11);    
TFMini tfmini;
int LED1Pin=2;
int LED2Pin=3;

void setup() {
  // Set Digital Pins to OUTPUT for LEDs
  pinMode (LED1Pin,OUTPUT);
  pinMode (LED2Pin,OUTPUT);
  Serial.println ("Initializing...");



void loop() {
  // Take one TF Mini distance measurement
  uint16_t dist = tfmini.getDistance();
  // Display the measurement

  // If measurement is within a distance range, flash corresponding LED
  if (dist <100 && dist>=50){
    delay (1000);
    delay (1000);

  // Wait some short time before taking the next measurement

Serial Monitor.png