def tile_h_2(current_state, goal_state):  # silly slow currently
    """
    Sum the distances for every tile out of position to their destination
    :param current_state:
    :param goal_state:
    :return:
    """
    count = 0
    for y, row in enumerate(current_state.state):
        for x, item in enumerate(row):
            for y2, i in enumerate(goal_state.state):
                try:
                    x2 = i.index(item)
                except ValueError:
                    continue

                count += abs(x - x2) + abs(y - y2)

    return count