def _get_demographics_adjusted_to_contact_matrix_agebins(P_AGE, POPULATION_SIZE):
    """
    Given that we are aggregating data from various sources, it is required that we adjust for the underlying assumptions.
    One of these structural assumption is of age groups. Contact matrices available consider only 16 classes while we assume 17 classes.
    This function aggregates numbers in the last two groups.

    Args:
        P_AGE (list): each element is a list of 3 elements - min age in the group, max age in the group, proportion of population that falls in this age group
            expects a total of 17 elements (age groups) in this list
        POPULATION_SIZE (int): total size of the population

    Returns:
        (list): each element is a list of 3 elements - min age in the group, max age in the group, number of people in this age group
            The list has a total of 16 elements (age groups) in this list.
    """
    assert len(P_AGE) == 16, "Unknown age breakdown"
    contact_matrix_age_bins = [[0,4], [5,9], [10,14], [15,19], [20,24], [25,29], [30,34], [35,39], [40,44], \
                         [45,49], [50,54], [55,59], [60,64], [65,69], [70,74], [75, 110]]
    N = []
    for i, x in enumerate(P_AGE):
        N += [[x[0], x[1], x[2] * POPULATION_SIZE]]

    assert len(N) == len(contact_matrix_age_bins), "age bins of contact matrix do not align with internal age bins"
    assert abs(sum(x[2] for x in N) - POPULATION_SIZE) < 1e-02, f"populations do not sum up, {sum(x[2] for x in N)} != {POPULATION_SIZE}"

    return N