Add function to join linked lists