added the code to sort 0,1,and 2 to form a sorted linked list