Updated speed & distance sensing logic