Playing around with threshold values to determine best distance for stopping