for index in range(len(segments)-1, 0, -1): x = segments[index-1].xcor() y = segments[index-1].ycor()