int make_friends(const char *name1, const char *name2, User *head) {
    User *curr1 = head;
    User *curr2 = head;
    User *store1 = NULL;
    User *store2 = NULL;
    while (curr1 != NULL) {
        if (strcmp(curr1->name, name1) == 0) {
            store1 = curr1;
        }
        else {
            curr1 = curr1->next;
        }
    }
    while (curr2 != NULL) {
        if (strcmp(curr2->name, name2) == 0) {
            store2 = curr2;
        }
        else {
            curr2 = curr2->next;
        }
    }
    if (store1 == NULL || store2 == NULL) {
        return 4; 
    }
    else if (store1 == store2) {
        return 3;
    }
    else if (store1->friends[MAX_FRIENDS] != NULL || store2->friends[MAX_FRIENDS] != NULL) {
        return 2;
    }
    else {
        for (int i = 0; i < MAX_FRIENDS; i++) {
            if (store1->friends[i] == store2) {
                return 1;
            }
            else if (store1->friends[i] != NULL) {
                store1 = store1->next;
            }
            else {
                store1->friends[i] = store2;
                for (int j = 0; j < MAX_FRIENDS; j++) {
                    if (store2->friends[j] != NULL) {
                        store2 = store2->next;
                    }
                    else {
                        store2->friends[j] = store1;
                    }
                }
            }
        }
    }
    return 0;
}