def update_subroute_distances(subroute, distances):
    """Update a subroute to have correct distances.

    Receives subroute as list of tuples in which each tuple's indices are
        0 = location-number     1 = distance-from-previous  2 = package-list
    We are updating the [1] index, distance-from-previous.
    """
    for index, stop in enumerate(subroute):
        if index == 0:
            continue
        prev, curr = subroute[index - 1][0], stop[0]
        dist = distances[prev][curr]
        subroute[index] = stop[0], dist, stop[2]
    return subroute
