create clear link_list function