def clean_up(subjects, attributes):
    """    
    This function takes a list of subject ids which correspond to attributes 
    in the second list, and forms a dictionary out of them, with the unique 
    subject id as the key and a list of their attributes as the corresponding 
    value.
    """
    # and as a one-liner:
    # return {sub : attributes[subjects.index(sub):subjects.index(sub)+subjects.count(sub)] for sub in set(subjects)}
    
    # create the empty dict that we will keep adding the stuff into one by one
    subject_dict = dict()
    # idx is the counter going from 0 to 38
    # using enumerate saves as the line: subj_id = subjects[idx]
    for idx, subj_id in enumerate(subjects):
        # if this is the first time we encounter this subject id, add it to the dict
        # the value is an empty list for now, we will now add all the attributes
        if subj_id not in subject_dict:
            subject_dict[subj_id] = []
        # add the current attribute to the list of the subject
        subject_dict[subj_id].append(attributes[idx])

    return subject_dict