if @Spanno < 2
stoffset = 'NEG'
else
lapcount = 1
for lapi in @Stjarray
if (distx > lapi[0]) && (distx < lapi[1])
stoffset = 'LAP'
break
elsif distx < lapi[0]
if lapcount.odd?
stoffset = 'NEG'
else
stoffset = 'POS'
end
break
elsif (distx > lapi[1]) && (lapcount == (@Spanno - 1))
if lapcount.odd?
stoffset = 'POS'
else
stoffset = 'NEG'
end
break
end
lapcount = lapcount + 1
end
end