def clean_first_markers(res):
    """
    In the event that a ToC was found, this will remove every first entry in the values of res. That means that all the
    location related to the titles in the ToC will be removed.

    :param res: dict, keys are sections to parse and contain the locations where the titles were found in the text.
    :return: Filtered version of res without the ToC locations
    """
    sections = list(res.keys())
    for idx in range(len(sections) - 1):
        counter_delete = 0
        for markers in res[sections[idx + 1]]:
            if markers[0] < res[sections[idx]][0][1]:
                counter_delete += 1
            else:
                break
        for _ in range(counter_delete):
            del res[sections[idx + 1]][0]
    return res
