def compare_states(start_state, end_state):
    """
    Helper function for comparing differences between two States.

    :type start_state: State
    :param start_state: The earlier state chronologically to be compared to.
    :type end_state: State
    :param end_state: The later state chronologically to be compared to.
    :return: list of tuples of differences between states in the form (dictionary, State object)
    """
    differences = []
    for result in end_state.results:
        if result in start_state.results:
            continue
        drift = []
        for field in result:
            value = field.split('|')
            if len(value) > 1:
                drift.append(value)
            else:
                drift.append(field)
        differences.append(drift)
    return differences
