removed unsigned specifier in ..read_distances, ...count_distances