added script for generating distances between all states of the same segment stage