breakdown linked list and sort